Browse Source

提交代码

朱鑫波 4 years ago
parent
commit
67a5bfb05f

+ 0 - 1
src/components/ctop/vm-card.vue

@@ -289,7 +289,6 @@ import { closeAllVideoFun } from '@/utils/videoControl'
 import propModal from './propModal'
 export default {
   name: 'VmCard',
-  mixins: [JeecgListMixin],
   components: {
     actorModal,
     UploadToAli,

+ 313 - 0
src/components/formComponents/checkBoxGroup.vue

@@ -0,0 +1,313 @@
+<style lang="scss">
+.ul-radio-group {
+  border-radius: 5px;
+  height: 32px;
+  padding: 0;
+  margin: 0;
+  border: none;
+  background: transparent;
+  .ant-checkbox {
+    display: none;
+  }
+  .btn {
+    background: transparent;
+    padding: 0;
+    margin: 0;
+    border: none;
+  }
+  .item {
+    min-width: 80px;
+    padding: 0px 15px;
+    text-align: center;
+    display: inline-block;
+    border: 1px solid #ccc;
+    border-left: 0;
+    height: 32px;
+    line-height: 32px;
+    cursor: pointer;
+    .checkbox-button-input {
+      width: 0;
+      height: 0;
+      opacity: 0;
+    }
+  }
+  .bgcolor {
+    color: rgba(0, 0, 0, 0.25);
+    background-color: #f5f5f5;
+    border-color: #d9d9d9;
+    cursor: not-allowed;
+  }
+  .item::after {
+    content: '';
+    position: absolute;
+    right: 1px;
+    top: -2px;
+    width: 0;
+    height: 0;
+    border-top: 6px solid transparent;
+    border-bottom: 6px solid transparent;
+    border-left: 6px solid;
+    border-left-color: #e0e0e0;
+    -webkit-transform: rotate(-45deg);
+    -ms-transform: rotate(-45deg);
+    transform: rotate(-45deg);
+    border-radius: 2px;
+  }
+  .item:hover {
+    color: #1890ff;
+  }
+  .selection {
+    color: #fff;
+    background: #1890ff;
+    // border-color: #1890ff;
+  }
+  .item.selection:hover {
+    color: #fff;
+    background: #40a9ff;
+  }
+  .item.selection:after {
+    border-left: 6px solid #1890ff;
+  }
+  .item:hover::after {
+    // border-color: #40a9ff;
+    border-left: 6px solid #40a9ff;
+  }
+  .bgcolor:hover {
+    color: rgba(0, 0, 0, 0.25);
+    background-color: #f5f5f5;
+    border-color: #d9d9d9;
+    cursor: not-allowed;
+  }
+  .bgcolor:hover::after {
+    // border-color: #40a9ff;
+    border-left: 6px solid #e0e0e0;
+  }
+  .bgcolor.selection:after {
+    border-left: 6px solid #e0e0e0;
+  }
+  .bgcolor.selection {
+    color: rgba(0, 0, 0, 0.25);
+    background-color: #f5f5f5;
+    border-color: #d9d9d9;
+    cursor: not-allowed;
+  }
+  .bgcolor.selection:hover {
+    // color: #1890ff;
+    color: rgba(0, 0, 0, 0.25);
+    background-color: #f5f5f5;
+    border-color: #d9d9d9;
+    cursor: not-allowed;
+  }
+  .bgcolor.selection:after {
+    border-left: 6px solid #e0e0e0;
+  }
+  .ant-checkbox-wrapper + .ant-checkbox-wrapper {
+    margin-left: 0;
+  }
+}
+.ul-radio-group .item:first-child {
+  border-radius: 5px 0 0 5px;
+  border-left: 1px solid #ccc;
+}
+.ul-radio-group .item.selection:first-child {
+  border-radius: 5px 0 0 5px;
+  border-left: 1px solid #1890ff;
+}
+.ul-radio-group .item.selection:nth-child(2) {
+  border-left: 1px solid #1890ff;
+}
+.ul-radio-group .item:first-child:after {
+  border-left: 0;
+}
+.ul-radio-group .item:last-child {
+  border-radius: 0px 5px 5px 0px;
+}
+</style>
+<template>
+  <div class="ul-radio-group">
+    <a-checkbox-group v-model="selectedVal" :disabled="disabled" style="width: 100%">
+      <a-checkbox
+        v-for="item of selectOption"
+        :label="item.label"
+        :key="item.value"
+        :value="item.value"
+        :class="{ item: true, selection: selectedVal.indexOf(item.value) > -1, bgcolor: item.disabled }"
+        >{{ item.label }}</a-checkbox
+      >
+    </a-checkbox-group>
+  </div>
+</template>
+
+<script>
+// import { dictionary } from '@/components/service/core/dictionary'
+import { isArray } from '@/utils/Tools'
+import { httpAction, getAction } from '@/api/manage'
+export default {
+  name: 'CheckboxGroup', // checkbox组件二次封装
+  props: {
+    code: {
+      // 参数code
+      type: String,
+      default: '',
+    },
+    allValue: {
+      type: Boolean,
+      default() {
+        return false
+      },
+    },
+    options: {
+      // 外部传入的option 可替代请求项
+      type: Array,
+      default() {
+        return []
+      },
+    },
+    value: {
+      // v-model绑定值
+      type: [Array, String],
+      default() {
+        return []
+      },
+    },
+    label: {
+      // label 绑定值
+      type: [Array, String],
+      default: '',
+    },
+    radioStyle: {
+      // 是否复选框模拟单选效果
+      type: Boolean,
+      default: false,
+    },
+    disabled: {
+      // 是否禁用
+      type: Boolean,
+      default: false,
+    },
+  },
+  components: {},
+  data() {
+    return {
+      selectOption: [],
+    }
+  },
+  watch: {
+    options(val) {
+      if (isArray(val)) {
+        this.selectOption.splice(0, this.selectOption.length)
+        this.selectOption.push(...val)
+      }
+    },
+    selectedVal(n, o) {
+      console.log(n, o)
+      if (this.radioStyle && !this.allValue) {
+        if (n.length == 0) {
+          this.selectedVal = o
+        }
+      }
+    },
+  },
+  computed: {
+    selectedVal: {
+      get: function () {
+        return this.value
+      },
+      set: function (val) {
+        this.selectChange(val)
+      },
+    },
+  },
+  mounted() {
+    this.$nextTick(() => {
+      if (this.code && this.options.length == 0) {
+        // 如果code值不为空且options.lengt==0, 则去请求字典项
+        this.getOptions()
+      } else {
+        // 否则直接获取外部传入的options
+        this.selectOption.splice(0, this.selectOption.length)
+        this.selectOption.push(...this.options)
+      }
+    })
+  },
+  methods: {
+    getOptions() {
+      // 获取字典项
+      getAction('/sys/dictItem/list', { dictId: this.code, pageSize: 1000, pageNo: 1 }).then((res) => {
+        if (res.success && isArray(res.result.records)) {
+          var data = res.result.records
+          data = data.map((item) => {
+            return {
+              label: item.itemText,
+              value: item.itemValue,
+              ...item,
+            }
+          })
+          if (this.allValue) {
+            data.unshift({ label: '不限', value: '' })
+          }
+          this.selectOption.push(...data)
+        }
+      })
+    },
+    selectChange(val) {
+      // 选择事件
+      if (!this.radioStyle) {
+        // 多选
+        var retrunData = []
+        let label = this.selectOption.filter((v) => val.findIndex((item) => item == v.value) > -1).map((v) => v.label)
+        if (this.allValue) {
+          if (val.findIndex((item) => item == '') == 0) {
+            retrunData = val.slice(-1)
+          } else if (val.findIndex((item) => item == '') == val.length - 1) {
+            retrunData = ['']
+          } else {
+            retrunData = val
+          }
+        } else {
+          retrunData = val
+        }
+
+        this.$emit('input', retrunData)
+        this.$emit('update:label', label)
+        this.$emit('change', val)
+        this.consoleFun('VALUE: ', val, 'LABEL:', label)
+      } else {
+        // 模拟单选radio效果
+        let selectVal = []
+        if (this.allValue) {
+          if (val.length == 0) {
+            selectVal = ['']
+          }
+        } else {
+          if (val.length == 0) {
+            selectVal = []
+          }
+        }
+
+        if (val.length > 0) {
+          selectVal = val.slice(-1)
+        }
+        let label = this.selectOption
+          .filter((v) => selectVal.findIndex((item) => item == v.value) > -1)
+          .map((v) => v.label)
+        this.$emit('input', selectVal)
+        this.$emit('update:label', label)
+        this.$emit('change', selectVal)
+        this.consoleFun('VALUE: ', selectVal, 'LABEL:', label)
+      }
+    },
+    emitChange(...args) {
+      // emit change事件
+      this.$emit('change', ...args)
+    },
+    consoleFun(...args) {
+      // 打印信息
+      if (process.env.NODE_ENV == 'development') {
+        console.log(...args)
+      }
+    },
+  },
+}
+</script>
+

+ 237 - 0
src/components/formComponents/radioCheck.vue

@@ -0,0 +1,237 @@
+<template>
+    <div class="radioCheck" >
+        
+            <label :class="{'item':true,'selection': selectValue.indexOf(item.value)>-1,'bgcolor':item.disabled}" v-for="(item,index) in checkArr" :key="index">
+                
+                <span>
+                    <input type="checkbox" :value="item.value"  class="checkbox-button-input" @click="radioCheckChange($event,item)">
+                </span>
+                <span>{{item.title}}</span>
+                
+            </label>
+            <!-- <label :class="{'item':true,'selection': selectValue.indexOf(item.value)>-1}" v-for="(item,index) in checkArr" :key="index" :disabled='item.disabled'>               
+                <span>
+                    <input type="checkbox" :value="item.value"  class="checkbox-button-input" @click="radioCheckChange">
+                </span>
+                <span>{{item.title}}</span>               
+            </label>        -->
+    </div>
+</template>
+
+<script>
+export default {
+    data() {
+        return {
+            selectValue:[''],
+            currentSelect:'',
+        }
+    },
+   
+    props:['checkArr','selectArr'],
+    watch:{
+        checkArr:{
+            handler(n,o){
+                // console.log(n,o)
+                this.selectValue=[];
+                let i=0;
+                this.checkArr.forEach((item,index)=>{
+                    // console.log(item)
+                    if(item.disabled==false){
+                        i++;
+                        this.selectValue[0]=item.value;
+                        // console.log(this.selectValue)
+                    }else if(item.disabled==undefined){
+                        if(item.checked){
+                            this.selectValue.push(item.value)
+                        }
+                        
+                    }
+                })
+                if(this.selectValue.length==0){
+                    this.selectValue=[''];
+                }
+                if(i==3){
+                    this.selectValue[0]='';
+                }
+                // console.log(this.selectValue)
+                this.$emit('getSonValue',this.selectValue)
+            },
+            deep:true,
+            // immediate: true
+
+        },
+        
+    },
+    methods: {
+        //单选多选的事件
+        radioCheckChange(e,item){
+            console.log(e.target,item,!item.disabled);
+            
+            this.currentSelect=e.target.value;
+            if(!item.disabled){
+
+                if(e.target.value=='' || this.selectValue.length==0 ){
+                    this.selectValue=[''];
+                }else{
+                    if(this.selectValue.indexOf('')>-1){
+                        let i=this.selectValue.indexOf('');
+                        this.selectValue.splice(0,1)
+                    }
+                    
+                    if(this.selectValue.indexOf(e.target.value)==-1){
+                        this.selectValue.push(e.target.value)
+                    }else if(this.selectValue.indexOf(e.target.value)>-1){
+                        this.selectValue=this.selectValue.filter((item)=>{
+                            return item!=e.target.value
+                        })  
+                    }
+
+                    if(this.selectValue.length==0){
+                        this.selectValue=[''];
+                    }
+                    
+                }
+            // console.log(this.currentSelect,this.selectValue);
+            }
+            this.$emit('getSonValue',this.selectValue)
+        },
+    },
+    mounted() {
+        // this.selectValue=[]
+        // console.log(this.checkArr)
+        this.checkArr.forEach((item,index)=>{
+            
+            if(item.disabled&&item.disabled!=undefined){
+                this.selectValue[0]=item.value
+            }else{
+                this.selectValue=['']
+            }
+        })
+        this.$emit('getSonValue',this.selectValue)
+    },
+}
+</script>
+
+<style lang="scss" scoped>
+.radioCheck{        
+    border-radius: 5px;
+    height: 32px;
+    padding: 0;
+    margin: 0;
+    border: none;
+    background: transparent;
+    .btn{
+        background: transparent;
+        padding: 0;
+        margin: 0;
+        border: none;
+    }
+    .item{
+        min-width: 80px;
+        padding: 0px 15px;
+        text-align: center;
+        display: inline-block;
+        border: 1px solid #ccc;
+        border-left: 0;
+        height: 32px;
+        line-height: 32px;
+        cursor: pointer;
+        .checkbox-button-input{
+            width: 0;
+            height: 0;
+            opacity: 0;
+        }
+
+    }
+    .bgcolor{
+        color:rgba(0, 0, 0, 0.25);
+        background-color: #f5f5f5;
+        border-color: #d9d9d9;
+        cursor: not-allowed;
+    }
+    .item::after{
+        content: "";
+        position: absolute;
+        right: 1px;
+        top: -2px;
+        width: 0;
+        height: 0;
+        border-top: 6px solid transparent;
+        border-bottom: 6px solid transparent;
+        border-left: 6px solid;
+        border-left-color: #e0e0e0;
+        -webkit-transform: rotate(-45deg);
+        -ms-transform: rotate(-45deg);
+        transform: rotate(-45deg);
+        border-radius: 2px;
+    }
+    .item:hover{
+        color: #1890ff;
+    }
+    .selection{
+        color: #1890ff;
+        background: #fff;
+        border-color: #1890ff;
+    }
+    .item.selection:hover{
+        // color: #1890ff;
+        color: #40a9ff;
+        background: #fff;
+        border-color: #40a9ff;
+    }
+    .item.selection:after{
+        border-left: 6px solid #1890ff;
+    }
+    .item:hover::after{
+        // border-color: #40a9ff;
+        border-left: 6px solid #40a9ff;
+    }
+    .bgcolor:hover{
+        color:rgba(0, 0, 0, 0.25);
+        background-color: #f5f5f5;
+        border-color: #d9d9d9;
+        cursor: not-allowed;
+    }
+    .bgcolor:hover::after{
+        // border-color: #40a9ff;
+        border-left: 6px solid #e0e0e0;
+    }
+    .bgcolor.selection:after{
+        border-left: 6px solid #e0e0e0;
+    }
+    .bgcolor.selection{
+        color:rgba(0, 0, 0, 0.25);
+        background-color: #f5f5f5;
+        border-color: #d9d9d9;
+        cursor: not-allowed;
+    }
+    .bgcolor.selection:hover{
+        // color: #1890ff;
+        color:rgba(0, 0, 0, 0.25);
+        background-color: #f5f5f5;
+        border-color: #d9d9d9;
+        cursor: not-allowed;
+    }
+    .bgcolor.selection:after{
+        border-left: 6px solid #e0e0e0;
+    }
+}
+.radioCheck .item:first-child {
+    border-radius: 5px 0 0 5px;
+    border-left: 1px solid #ccc;
+}
+.radioCheck .item.selection:first-child {
+    border-radius: 5px 0 0 5px;
+    border-left: 1px solid #1890ff;
+}
+.radioCheck .item.selection:nth-child(2) {
+    
+    border-left: 1px solid #1890ff;
+}
+.radioCheck .item:first-child:after{
+    border-left: 0;
+}
+.radioCheck .item:last-child {
+    border-radius: 0px 5px 5px 0px;
+}
+</style>

+ 358 - 0
src/components/formComponents/selectGroup.vue

@@ -0,0 +1,358 @@
+<template>
+  <a-select
+    :title="title"
+    v-model="selectedVal"
+    :collapse-tags="collapseTags"
+    :placeholder="placeholder"
+    :allow-create="allowCreate"
+    :allowClear="allowClear"
+    :mode="multiple ? 'multiple' : 'default'"
+    :disabled="disabled"
+    :filterOption="filterOptionAll"
+    :remote="remote"
+    :remote-method="remoteMethod"
+    :maxTagCount="maxTagCount"
+  >
+    <a-select-option v-for="(item, index) in filterOption" :value="item.value" :key="'select' + item.value + index">
+      {{ item.label }}
+    </a-select-option>
+  </a-select>
+</template>
+<script>
+// import { dictionary } from '@/components/service/core/dictionary'
+// import { queryParaCascByIdAndParamType } from '@/components/service/core/sysConfig'
+import { isArray } from '@/utils/Tools'
+import { httpAction, getAction } from '@/api/manage'
+export default {
+  name: 'selectPara',
+  props: {
+    code: {
+      // 字典代码
+      type: String,
+      default: '',
+    },
+    value: {
+      // v-model绑定值
+      type: [String, Array, Number, Boolean],
+      default() {
+        if (this.multiple) return []
+        else return ''
+      },
+    },
+    label: {
+      // label值
+      type: [String, Array, Number],
+      default() {
+        if (this.multiple) {
+          return []
+        }
+        if (!this.multiple) {
+          return ''
+        }
+      },
+    },
+    collapseTags: {
+      // 多选时是否将选中值按文字的形式展示
+      type: Boolean,
+      default: false,
+    },
+    placeholder: {
+      type: String,
+      default: '请选择',
+    },
+    options: {
+      // 外部传入的options 可代替自带的请求项
+      type: Array,
+      default() {
+        return []
+      },
+    },
+    allowCreate: {
+      // 是否允许创建新条目
+      type: Boolean,
+      default: false,
+    },
+    defaultFirstOption: {
+      // 按回车键 选择第一项
+      type: Boolean,
+      default: false,
+    },
+    allowClear: {
+      // 选项是否可清除
+      type: Boolean,
+      default: true,
+    },
+    disabled: {
+      // 是否禁用
+      type: Boolean,
+      default: false,
+    },
+    multiple: {
+      // 是否多选
+      type: Boolean,
+      default: false,
+    },
+    filterable: {
+      // 模糊搜索
+      type: Boolean,
+      default: false,
+    },
+    remote: {
+      // 远程搜索
+      type: Boolean,
+      default: false,
+    },
+    remoteMethod: {
+      // 远程搜索方法
+      type: Function,
+      default: () => {
+        console.error('没有配置远程搜索方法!')
+      },
+    },
+    disabledChange: {
+      // 禁用change事件
+      type: Boolean,
+      default: false,
+    },
+    enable: {
+      // 允许选择的项   为空数组全显示,不为空数组只显示规定的选项
+      type: Array,
+      default() {
+        return []
+      },
+    },
+    casCode: {
+      // 下级级联参数的code
+      type: String,
+      default: '',
+    },
+    casVal: {
+      // 下级参数绑定值
+      type: [String, Number],
+      default: '',
+    },
+    casLabel: {
+      // 下级参数绑定label
+      type: String,
+      default: '',
+    },
+    casOpt: {
+      // 级联参数options
+      type: Array,
+      default() {
+        return []
+      },
+    },
+    maxTagCount: {
+      type: Number,
+      default() {
+        return 2
+      },
+    },
+  },
+  data() {
+    return {
+      selectOption: [],
+      visible: false,
+      label_tmp: null,
+    }
+  },
+  watch: {
+    options(val) {
+      if (isArray(val)) {
+        this.selectOption.splice(0, this.selectOption.length)
+        this.selectOption.push(...val)
+      }
+    },
+    value(val, oldVal) {
+      if (!this.valueEquals(val, oldVal)) {
+        this.selectChange(val)
+      }
+    },
+  },
+  computed: {
+    selectedVal: {
+      get: function () {
+        return this.value
+      },
+      set: function (val) {
+        this.$emit('input', val)
+      },
+    },
+    filterOption() {
+      // 过滤后的下拉项
+      if (this.enable.length == 0) {
+        return this.selectOption
+      } else {
+        return this.selectOption.filter((v) => this.enable.findIndex((item) => item == v.value) > -1)
+      }
+    },
+    title() {
+      // title提示文字
+      if (!this.multiple) {
+        return this.filterOption.filter((v) => v.value == this.value).length == 1
+          ? this.filterOption.filter((v) => v.value == this.value)[0].label
+          : ''
+      } else if (this.multiple) {
+        return this.filterOption
+          .filter((item) => {
+            return this.value.findIndex((v) => v == item.value) > -1
+          })
+          .map((item2) => item2.label)
+      }
+      if (this.enable.length > 0) {
+        return this.filterOption.map((v) => v.label)
+      }
+    },
+  },
+  mounted() {
+    this.$nextTick(() => {
+      if (this.code && this.options.length == 0) {
+        // 如果code值不为空且options.lengt==0, 则去请求字典项
+        this.getOptions()
+      } else {
+        // 否则将外部传入的options显示到下拉框中
+        this.selectOption.splice(0, this.selectOption.length)
+        this.selectOption.push(...this.options)
+        this.setDefaultVal(this.selectOption)
+      }
+    })
+  },
+  methods: {
+    filterOptionAll(input, option) {
+      return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
+    },
+    getOptions() {
+      // 获取字典项
+
+      getAction('/sys/dictItem/list', { dictId: this.code, pageSize: 1000, pageNo: 1 }).then((res) => {
+        if (res.success && isArray(res.result.records)) {
+          let data = res.result.records
+          data = data.map((v) => {
+            return {
+              ...v,
+              label: v.itemText,
+              value: v.itemValue,
+            }
+          })
+          this.selectOption.splice(0, this.selectOption.length)
+          this.selectOption.push(...data)
+          this.setDefaultVal(this.selectOption)
+        }
+      })
+    },
+    selectChange(val) {
+      // 选择change事件
+      if (this.multiple) {
+        // 多选
+        if (isArray(val) && val.length == 0) {
+          this.$emit('update:label', [])
+          this.emitChange([], [])
+          return
+        }
+        if (isArray(val) && val.length > 0) {
+          this.label_tmp = val.map((v) => {
+            let item = this.selectOption.find((n) => {
+              return n.value == v
+            })
+            if (item) {
+              return item.label
+            }
+          })
+          this.$emit('update:label', this.label_tmp)
+          this.emitChange(val, this.label_tmp)
+        }
+      }
+
+      if (!this.multiple) {
+        // 单选
+        if (!this.valueEquals(val, this.selectedVal)) return
+        if (!val) {
+          this.emitChange('', '', '')
+          this.$emit('update:label', '')
+          this.clearCascadeOpt()
+          return
+        }
+        let total = 0
+        let interval = window.setInterval(() => {
+          // 定时 解决下级级联参数没有触发change事件的问题
+          total++
+          let obj = this.selectOption.find((v) => v.value == val)
+          if (obj) {
+            this.$emit('update:label', obj.label)
+            this.emitChange(this.selectedVal, obj.id, obj.cId)
+            this.getCascadeOption(obj.id)
+            window.clearInterval(interval)
+          }
+          if (total >= 200) {
+            // 超过2秒 结束计数
+            window.clearInterval(interval)
+          }
+        }, 10)
+      }
+    },
+    valueEquals(a, b) {
+      // 比较两个值是否相同
+      if (a === b) return true
+      if (!(a instanceof Array)) return false
+      if (!(b instanceof Array)) return false
+      if (a.length !== b.length) return false
+      for (let i = 0; i !== a.length; ++i) {
+        if (a[i] !== b[i]) return false
+      }
+      return true
+    },
+    emitChange(...args) {
+      // 触发外部change方法
+      if (!this.disabledChange) {
+        setTimeout(() => {
+          this.$emit('change', ...args)
+        }, 1)
+      }
+    },
+    // 获取下级级联参数的options 开始==================
+    getCascadeOption(id) {
+      // 获取下级级联参数
+      if (!this.casCode) return
+      queryParaCascByIdAndParamType(id, this.casCode).then((res) => {
+        if (res.data.code == 1000) {
+          let data = res.data.data
+          if (isArray(data)) {
+            data = data.map((item) => {
+              return {
+                value: item.valStr,
+                label: item.name,
+                ...item,
+              }
+            })
+            this.$emit('update:casOpt', data)
+            this.clearCascadeVal()
+          }
+        }
+      })
+    },
+    clearCascadeOpt() {
+      // 清空下级级联参数
+      if (!this.casCode) return
+      this.$emit('update:casOpt', [])
+      this.clearCascadeVal()
+    },
+    clearCascadeVal() {
+      // 清空下级参数绑定值
+      this.$emit('update:casVal', '')
+      this.$emit('update:casLabel', '')
+    },
+    // 获取下级级联参数的options 结束==================
+    setDefaultVal(options = []) {
+      // 设置默认值(只有值为空的情况下可以设置默认值)
+      let def = options.find((v) => v.haveDefault == '1')
+      if (def) {
+        if (!this.value && this.value !== 0) {
+          this.$emit('input', def.value)
+          this.$emit('update:label', def.name)
+        }
+      }
+    },
+  },
+}
+</script>

+ 46 - 34
src/components/music-list/music-list.vue

@@ -20,12 +20,7 @@
           <div class="list-name">
             <span>{{ item.name }}</span>
             <div class="list-menu">
-              <mm-icon
-                class="hover"
-                :type="getPlayIconType(item)"
-                :size="40"
-                @click.stop="selectItem(item, index)"
-              />
+              <mm-icon class="hover" :type="getPlayIconType(item)" :size="40" @click.stop="selectItem(item, index)" />
             </div>
           </div>
           <span class="list-artist">{{ item.singer }}</span>
@@ -37,10 +32,16 @@
               :size="40"
               @click.stop="deleteItem(item, index)"
             /> -->
-            <a class="hover list-menu-icon-del" style="font-size:16px" @click.stop="deleteItem(item, index)">下载</a>
+            <a class="hover list-menu-icon-del" style="font-size: 16px" @click.stop="deleteItem(item, index)">下载</a>
           </span>
-          <span v-else class="list-album">{{ item.album }}
-            <a class="hover list-menu-icon-del" style="font-size:16px;float:right;margin-right:10px" @click.stop="deleteItem(item, index)">下载</a>
+          <span v-else class="list-album"
+            >{{ item.album }}
+            <a
+              class="hover list-menu-icon-del"
+              style="font-size: 16px; float: right; margin-right: 10px"
+              @click.stop="deleteItem(item, index)"
+              >下载</a
+            >
           </span>
         </div>
         <slot name="listBtn"></slot>
@@ -55,21 +56,22 @@
 import { mapGetters, mapMutations } from 'vuex'
 import { format } from '@/utils/util'
 import MmNoResult from '@base/mm-no-result/mm-no-result'
+import { postAction, downFilePost } from '../../api/manage'
 
 const musicUrl = 'https://music.163.com/song/media/outer/url'
 export default {
   name: 'MusicList',
   components: {
-    MmNoResult
+    MmNoResult,
   },
   filters: {
-    format
+    format,
   },
   props: {
     // 歌曲数据
     list: {
       type: Array,
-      default: () => []
+      default: () => [],
     },
     /**
      *  0:显示专辑栏目(默认)
@@ -77,16 +79,16 @@ export default {
      */
     listType: {
       type: Number,
-      default: 0
-    }
+      default: 0,
+    },
   },
   data() {
     return {
-      lockUp: true // 是否锁定滚动加载事件,默认锁定
+      lockUp: true, // 是否锁定滚动加载事件,默认锁定
     }
   },
   computed: {
-    ...mapGetters(['playing', 'currentMusic'])
+    ...mapGetters(['playing', 'currentMusic']),
   },
   watch: {
     list(newList, oldList) {
@@ -95,17 +97,13 @@ export default {
       }
       if (newList.length !== oldList.length) {
         this.lockUp = false
-      } else if (
-        newList[newList.length - 1].id !== oldList[oldList.length - 1].id
-      ) {
+      } else if (newList[newList.length - 1].id !== oldList[oldList.length - 1].id) {
         this.lockUp = false
       }
-    }
+    },
   },
   activated() {
-    this.scrollTop &&
-      this.$refs.listContent &&
-      (this.$refs.listContent.scrollTop = this.scrollTop)
+    this.scrollTop && this.$refs.listContent && (this.$refs.listContent.scrollTop = this.scrollTop)
   },
   methods: {
     // 滚动事件
@@ -163,7 +161,7 @@ export default {
     getPlayIconType({ id: itemId }) {
       const {
         playing,
-        currentMusic: { id }
+        currentMusic: { id },
       } = this
       return playing && id === itemId ? 'pause-mini' : 'play-mini'
     },
@@ -171,18 +169,32 @@ export default {
     deleteItem(item, index) {
       // this.$emit('del', index) // 触发删除事件
       // console.log(item, index)
-      let downloadElement = document.createElement('a')
-      downloadElement.href = musicUrl + '?id=' + item.id + '.mp3'
-      downloadElement.download = item.name
-      downloadElement.target = '_blank'
-      document.body.appendChild(downloadElement)
-      downloadElement.click()
-      document.body.removeChild(downloadElement)
+      // let downloadElement = document.createElement('a')
+      // downloadElement.href = musicUrl + '?id=' + item.id + '.mp3'
+      // downloadElement.download = item.name
+      // downloadElement.target = '_blank'
+      // document.body.appendChild(downloadElement)
+      // downloadElement.click()
+      // document.body.removeChild(downloadElement)
+
+      downFilePost('/ctop/bytedanceMusicInfo/netEaseDownLoad', {
+        musicName: item.name,
+        musicUrl: musicUrl + '?id=' + item.id + '.mp3',
+      }).then((res) => {
+        const blob = new Blob([res], { type: 'audio/mpeg' })
+        const a = document.createElement('a')
+        const url = window.URL.createObjectURL(blob)
+        const filename = item.musicInfo.name
+        a.href = url
+        a.download = filename
+        a.click()
+        window.URL.revokeObjectURL(url)
+      })
     },
     ...mapMutations({
-      setPlaying: 'SET_PLAYING'
-    })
-  }
+      setPlaying: 'SET_PLAYING',
+    }),
+  },
 }
 </script>
 

+ 342 - 0
src/utils/Tools.js

@@ -0,0 +1,342 @@
+
+
+export const pickerOptions = [{
+        text: "今天",
+        onClick(picker) {
+            const end = new Date();
+            const start = new Date();
+            start.setTime(start.getTime());
+            picker.$emit('pick', [start, end]);
+        }
+    },
+    {
+        text: "昨天",
+        onClick(picker) {
+            const end = new Date();
+            const start = new Date();
+            start.setDate(start.getDate() - 1);
+            end.setDate(end.getDate() - 1);
+            picker.$emit('pick', [start, end]);
+        }
+    },
+    {
+        text: "最近七天",
+        onClick(picker) {
+            const end = new Date();
+            const start = new Date();
+            start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
+            picker.$emit('pick', [start, end]);
+        }
+    },
+    {
+        text: "最近30天",
+        onClick(picker) {
+            const end = new Date();
+            const start = new Date();
+            start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
+            picker.$emit('pick', [start, end]);
+        }
+    },
+    {
+        text: "本月",
+        onClick(picker) {
+            const start = new Date();
+            const end = new Date(start);
+            end.setMonth(start.getMonth() + 1);
+            end.setDate(0);
+            start.setDate(1);
+            picker.$emit('pick', [start, end]);
+        }
+    },
+    {
+        text: "上个月",
+        onClick(picker) {
+            const start = new Date();
+            const end = new Date(start);
+            end.setMonth(start.getMonth());
+            start.setMonth(start.getMonth() - 1);
+            end.setDate(0);
+            start.setDate(1);
+            picker.$emit('pick', [start, end]);
+        }
+    },
+    {
+        text: "去年",
+        onClick(picker) {
+            const endYear = new Date().getFullYear() - 1;
+            const startYear = new Date().getFullYear() - 1;
+            const start = new Date(startYear, 0, 1);
+            const end = new Date(endYear, 11, 31);
+            picker.$emit('pick', [start, end]);
+        }
+    },
+    {
+        text: "今年",
+        onClick(picker) {
+            const endYear = new Date().getFullYear();
+            const startYear = new Date().getFullYear();
+            const start = new Date(startYear, 0, 1);
+            const end = new Date(endYear, 11, 31);
+            picker.$emit('pick', [start, end]);
+        }
+    },
+    {
+        text: "最近一年",
+        onClick(picker) {
+            const end = new Date();
+            const start = new Date();
+            start.setFullYear(start.getFullYear() - 1);
+            picker.$emit('pick', [start, end]);
+        }
+    },
+];
+
+/**
+ * tree 形结构格式化
+ * @param {any} data 
+ */
+export const initTree = {
+
+}
+
+/**
+ * 判断是否是数组
+ * @param {Array} arr 
+ */
+export const isArray = (arr) => {
+    return Object.prototype.toString.call(arr) == '[object Array]'
+}
+
+/**
+ * 手机号屏蔽
+ */
+export const hidePhone = (num) => {
+    if (num) {
+        let newNum = String(num);
+        return newNum.replace(/^(\d{3})\d{4}(\d{4})$/, '$1****$2');
+    }
+}
+/**
+ * 时间格式转化
+ * @param {Array} arr 
+ */
+export const dateReturn1 = (date1) => {
+    date1.toLocaleString("en-US", {
+        hour12: false
+    }).replace(/\b\d\b/g, '0><').replace(new RegExp('/', 'gm'), '-');
+}
+/**
+ * 十五分钟倒计时
+ * @param {Array}string
+ */
+export const fiftyDate = () => {
+    let now = new Date();
+    var hour = now.getHours();
+    var minu = now.getMinutes();
+    var sec = now.getSeconds();
+    if (hour < 10) hour = "0" + hour;
+
+    if (minu < 10) minu = "0" + minu;
+
+    if (sec < 10) sec = "0" + sec;
+    var time = "";
+    time = hour + ":" + minu + ":" + sec
+    console.info('倒计时--->', time);
+}
+
+/**
+ * 输入框单字节计算
+ * @param string
+ */
+export const strSubleng = (str) => {
+    var len = 0;
+    for (var i = 0; i < str.length; i++) {
+        var c = str.charCodeAt(i);
+        if ((c >= 0x0001 && c <= 0x007e) || (0xff60 <= c && c <= 0xff9f)) { //单字节加1
+            len++;
+        } else {
+            len += 2;
+        }
+    }
+    return len;
+}
+/**
+ * 截取路由参数
+ * @param string
+ */
+export const subparams = (str) => {
+    //let search = location.search;
+    let params = {};
+    if (str != "") {
+        str.slice(1).split("&").forEach((v) => {
+            let arr = v.split("=");
+            params[arr[0]] = arr[1];
+        })
+    }
+    return params;
+}
+
+/**
+ * get url 对象序列化
+ * @param string
+ */
+export const http_builder_url = (url, data) => {
+    if (typeof (url) == 'undefined' || url == null) {
+        return '';
+    }
+    if (typeof (data) == 'undefined' || data == null || typeof (data) != 'object') {
+        return '';
+    }
+    url += (url.indexOf("?") != -1) ? "" : "?";
+    for (var k in data) {
+        url += ((url.indexOf("=") != -1) ? "&" : "") + k + "=" + encodeURI(data[k]);
+        console.log(url);
+    }
+    return url;
+}
+
+/**
+ * 存储localStorage
+ * @param {any} data 
+ */
+export const setStore = (name, content) => {
+    if (!name) return
+    if (typeof content !== 'string') {
+        content = JSON.stringify(content);
+    }
+    window.localStorage.setItem(name, content);
+}
+/**
+ * 获取localStorage
+ * @param {any} data 
+ */
+export const getStore = name => {
+    if (!name) return;
+    return window.localStorage.getItem(name);
+}
+/**
+ *删除localStorage
+ * @param {any} data 
+ */
+export const removeStore = name => {
+    if (!name) return;
+    window.localStorage.removeItem(name);
+}
+
+/**
+ *去除字符串中逗号
+ * @param {any} data 
+ */
+export const clear = str => {
+    str = str.replace(/,/g, '')
+    return str;
+}
+
+/**
+ * 全屏显示
+ * @param {any} data 
+ */
+export const requestFullScreen = () => {
+    let elem = document.documentElement;
+    if (elem.requestFullscreen) {
+        elem.requestFullscreen()
+    } else if (elem.mozRequestFullScreen) {
+        elem.mozRequestFullScreen()
+    } else if (elem.webkitRequestFullScreen) {
+        elem.webkitRequestFullScreen()
+    } else if (elem.msRequestFullscreen) {
+        document.body.msRequestFullscreen()
+    }
+}
+/**
+ * 退出全屏
+ * @param {any} data 
+ */
+export const exitFullscreen = () => {
+    let doc = document
+    if (doc.exitFullscreen) {
+        doc.exitFullscreen()
+    } else if (doc.mozCancelFullScreen) {
+        doc.mozCancelFullScreen()
+    } else if (doc.webkitCancelFullScreen) {
+        doc.webkitCancelFullScreen()
+    } else if (doc.msExitFullscreen) {
+        document.msExitFullscreen()
+    }
+}
+
+
+/**
+ * 将简单数据格式转换成嵌套的数据格式
+ * @param {Object} setting 
+ * @param {Array} sNodes 
+ */
+export const transformTozTreeFormat = (sNodes, setting={}) => { 
+    var i, l,
+        key = setting.idKey || 'id',
+        parentKey = setting.parentKey || 'parentId',
+        childKey = setting.childKey || 'children';
+    if (!key || key == "" || !sNodes) return [];
+
+    if (isArray(sNodes)) {
+        var r = [];
+        var tmpMap = {};
+        for (i = 0, l = sNodes.length; i < l; i++) {
+            tmpMap[sNodes[i][key]] = sNodes[i];
+        }
+        for (i = 0, l = sNodes.length; i < l; i++) {
+            if (tmpMap[sNodes[i][parentKey]] && sNodes[i][key] != sNodes[i][parentKey]) {
+                if (!tmpMap[sNodes[i][parentKey]][childKey])
+                    tmpMap[sNodes[i][parentKey]][childKey] = [];
+                tmpMap[sNodes[i][parentKey]][childKey].push(sNodes[i]);
+            } else {
+                r.push(sNodes[i]);
+            }
+        }
+        return r;
+    } else {
+        return [sNodes];
+    }
+}
+
+/**
+ * 将嵌套的数据格式转换成简单数据格式
+ * @param {Object} setting 
+ * @param {Array} nodes 
+ */
+export const transformToArrayFormat = (nodes, setting={}) => {
+    if (!nodes) return [];
+    var childKey = setting.childKey || 'children',
+        r = [];
+    if (isArray(nodes)) {
+        for (var i = 0, l = nodes.length; i < l; i++) {
+            r.push(nodes[i]);
+            if (nodes[i][childKey])
+                r = r.concat(transformToArrayFormat(nodes[i][childKey], setting));
+        }
+    } else {
+        r.push(nodes);
+        if (nodes[childKey])
+            r = r.concat(transformToArrayFormat(nodes[childKey], setting));
+    }
+    return r;
+}
+
+/**将对象转换成url查询格式
+ * 
+ * @param {} url 
+ * @param {*} data 
+ */
+export const changeParam = (url, data) => {
+    if(typeof(url) == 'undefined' || url == null) {
+        return '';
+    }
+    if(typeof(data) == 'undefined' || data == null || typeof(data) != 'object') {
+        return '';
+    }
+    url += (url.indexOf("?") != -1) ? "" : "?";
+    for(var k in data) {
+        url += ((url.indexOf("=") != -1) ? "&" : "") + k + "=" + encodeURI(data[k]);
+    }
+    return url;
+}

+ 2 - 2
src/views/modules/advertiser/modules/projectListModal.vue

@@ -327,8 +327,8 @@ export default {
       //       }
       if (record.mediaId == '2' || record.mediaId == '4') {
         var params = { ...record }
-        params.bidType = record.bidType == null ? [2] : JSON.parse(record.bidType)
-        params.ocpxActionType = record.ocpxActionType == null ? [2] : JSON.parse(record.ocpxActionType)
+        params.bidType = (record.bidType == null||record.bidType == '') ? [2] : JSON.parse(record.bidType)
+        params.ocpxActionType = (record.ocpxActionType == null||record.ocpxActionType == '') ? [2] : JSON.parse(record.ocpxActionType)
         this.showDian = true
       } else {
         var { ocpxActionType, bidType, ...params } = record

File diff suppressed because it is too large
+ 1422 - 0
src/views/modules/earlyWarningRules/ruleModule.vue


+ 14 - 15
src/views/modules/kuaishouapp/account/stepForm/Step3.vue

@@ -197,7 +197,7 @@ li.chouzhen.first:before {
                           >
                             <a-checkbox-group
                               v-model="item.checkArrImage"
-                              style="width: 100%; display: flex; padding-left: 0"
+                              style="width: 100%; display: flxex; padding-left: 0"
                               @change="onChangeCheckImage"
                             >
                               <li v-for="(item, index) of item.imageUrlList" :key="index">
@@ -447,14 +447,13 @@ li.chouzhen.first:before {
               mode="tags"
               style="width: 100%"
               placeholder="按回车生成标签"
-              v-decorator="[
-                'creativeTag',
-                { rules: [{ required: true, message: '标签必选' }, { validator: creativeTagValid }] },
-              ]"
+              v-decorator="['creativeTag', { validator: creativeTagValid }]"
               dropdownClassName="display-none-selset"
               :token-separators="[',', ' ', ',']"
             >
             </a-select>
+            <span v-if="getData('creativeTag')&&getData('creativeTag').length > 10" style="color:red">创意标签最多填写10个,请删减</span>
+            <br>
             <a-popconfirm @confirm="getInfo(record)">
               <div slot="title">
                 <div>
@@ -2229,16 +2228,16 @@ export default {
           }
         })
         this.pansKey = this.pans[0].key
-        setTimeout(() => {
-          if (
-            this.pane.sceneId.indexOf(5) >= 0 ||
-            this.pane.sceneId.indexOf(1) >= 0 ||
-            this.pane.sceneId.indexOf(7) >= 0 ||
-            this.pane.sceneId.indexOf(6) >= 0
-          ) {
-            this.addCreative(0)
-          }
-        }, 0)
+        // setTimeout(() => {
+        //   if (
+        //     this.pans.sceneId.indexOf(5) >= 0 ||
+        //     this.pans.sceneId.indexOf(1) >= 0 ||
+        //     this.pans.sceneId.indexOf(7) >= 0 ||
+        //     this.pans.sceneId.indexOf(6) >= 0
+        //   ) {
+        //     this.addCreative(0)
+        //   }
+        // }, 0)
 
         getAction('/kuaishou/batch/checkCreativeCount', {
           unitId: this.pansKey,

+ 3 - 1
src/views/modules/kuaishouapp/account/stepForm/Step4.vue

@@ -394,11 +394,13 @@ li.chouzhen.first:before {
               mode="tags"
               style="width: 100%"
               placeholder="按回车生成标签"
-              v-decorator="['creativeTag',{ rules: [{ required: true, message: '标签必选' }, { validator: creativeTagValid }] }]"
+              v-decorator="['creativeTag', { validator: creativeTagValid }]"
               dropdownClassName="display-none-selset"
               :token-separators="[',',' ',',']"
             >
             </a-select>
+            <span v-if="getData('creativeTag')&&getData('creativeTag').length > 10" style="color:red">创意标签最多填写10个,请删减</span>
+            <br>
             <a-popconfirm @confirm="getInfo(record)">
               <div slot="title">
                 <div>

+ 13 - 9
src/views/modules/material/musicBytedance.vue

@@ -452,7 +452,7 @@ body {
                 <use xlink:href="#icon-heart-o"></use>
               </svg>
             </div>
-            <a :href="currentTrack.url" target="_blank" class="player-controls__item">
+            <a @click="downLoad(currentTrack)" class="player-controls__item">
               <svg class="icon">
                 <use xlink:href="#icon-link"></use>
               </svg>
@@ -592,7 +592,7 @@ body {
 
 <script>
 import { defaultSheetId } from '@/config'
-import { postAction } from '../../../api/manage'
+import { postAction, downFilePost } from '../../../api/manage'
 
 export default {
   name: 'Music-dy',
@@ -685,13 +685,16 @@ export default {
   },
   methods: {
     downLoad(item) {
-      let downloadElement = document.createElement('a')
-      downloadElement.href = item.musicInfo.musicUrl
-      downloadElement.download = item.musicInfo.name //下载后文件名
-      downloadElement.target = '_blank'
-      document.body.appendChild(downloadElement)
-      downloadElement.click() //点击下载
-      document.body.removeChild(downloadElement) //下载完成移除元素
+      downFilePost('/ctop/bytedanceMusicInfo/downLoad?id=' + item.musicId, {}).then((res) => {
+        const blob = new Blob([res], { type: 'audio/mpeg' })
+        const a = document.createElement('a')
+        const url = window.URL.createObjectURL(blob)
+        const filename = item.musicInfo.name
+        a.href = url
+        a.download = filename
+        a.click()
+        window.URL.revokeObjectURL(url)
+      })
     },
     searchQuery() {
       this.getDataList({ pageNo: 1, pageSize: 10, typeValue: this.type, musicName: this.music, author: this.author })
@@ -705,6 +708,7 @@ export default {
           source: item.musicInfo.musicUrl,
           url: item.musicInfo.musicUrl,
           favorited: false,
+          musicId:item.musicInfo.id
         }
       })
       this.$nextTick(() => {

+ 117 - 171
src/views/modules/yard/modules/YardModal.vue

@@ -6,82 +6,31 @@
     :confirmLoading="confirmLoading"
     @ok="handleOk"
     @cancel="handleCancel"
-    cancelText="关闭">
-
+    cancelText="关闭"
+  >
     <a-spin :spinning="confirmLoading">
       <a-form :form="form">
-
-        <a-form-item
-          :labelCol="labelCol"
-          :wrapperCol="wrapperCol"
-          label="场地名称">
-          <a-input placeholder="请输入场地名称" v-decorator="['buildingName']"/>
+        <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="场地名称">
+          <a-input placeholder="请输入场地名称" v-decorator="['buildingName']" />
         </a-form-item>
-        <a-form-item
-          :labelCol="labelCol"
-          :wrapperCol="wrapperCol"
-          label="地址">
-          <a-input placeholder="请输入地址" v-decorator="['address']"/>
+        <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="地址">
+          <a-input placeholder="请输入地址" v-decorator="['address']" />
         </a-form-item>
-        <a-form-item
-          label="照片"
-          :labelCol="labelCol"
-          :wrapperCol="wrapperCol"
-        >
-        <uploadFile v-if="visible" :value.sync="imageUrl" :fileCount="10" uploadType="image" />
-          <!-- <upload-to-ali
-            v-model="imageUrl"
-            :customDomain="customDomain"
-            multiple
-            preview
-            :region="region"
-            :bucket="bucket"
-            :accept="acceptImage"
-            :max="10"
-            :size="1024000"
-            :accessKeyId="accessKeyId"
-            :accessKeySecret="accessKeySecret"
-          ></upload-to-ali> -->
+        <a-form-item label="照片" :labelCol="labelCol" :wrapperCol="wrapperCol">
+          <uploadFile v-if="visible" :value.sync="imageUrl" :fileCount="10" uploadType="image" />
         </a-form-item>
-        <a-form-item
-          label="视频"
-          :labelCol="labelCol"
-          :wrapperCol="wrapperCol"
-        >
-
-         <uploadFile  v-if="visible" :value.sync="videoUrl" :fileCount="1" uploadType="video" />
-          <!-- <upload-to-ali
-            v-model="videoUrl"
-            :customDomain="customDomain"
-            multiple
-            preview
-            :region="region"
-            :bucket="bucket"
-            :accept="acceptVideo"
-            :max="10"
-            :size="1024000"
-            :accessKeyId="accessKeyId"
-            :accessKeySecret="accessKeySecret"
-          ></upload-to-ali> -->
+        <a-form-item label="视频" :labelCol="labelCol" :wrapperCol="wrapperCol">
+          <uploadFile v-if="visible" :value.sync="videoUrl" :fileCount="10" uploadType="video" />
         </a-form-item>
 
-        <a-form-item
-          :labelCol="labelCol"
-          :wrapperCol="wrapperCol"
-          label="联系人姓名">
-          <a-input placeholder="请输入联系人姓名" v-decorator="['contactName']"/>
+        <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="联系人姓名">
+          <a-input placeholder="请输入联系人姓名" v-decorator="['contactName']" />
         </a-form-item>
-        <a-form-item
-          :labelCol="labelCol"
-          :wrapperCol="wrapperCol"
-          label="联系人电话">
-          <a-input placeholder="请输入联系人电话" v-decorator="['contactMobile']"/>
+        <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="联系人电话">
+          <a-input placeholder="请输入联系人电话" v-decorator="['contactMobile']" />
         </a-form-item>
-        <a-form-item
-          :labelCol="labelCol"
-          :wrapperCol="wrapperCol"
-          label="备注">
-          <a-input placeholder="请输入备注" v-decorator="['remark']"/>
+        <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="备注">
+          <a-input placeholder="请输入备注" v-decorator="['remark']" />
         </a-form-item>
       </a-form>
     </a-spin>
@@ -89,122 +38,119 @@
 </template>
 
 <script>
-  import {httpAction} from '@/api/manage'
-  import pick from 'lodash.pick'
-  import JTreeSelect from '@/components/jeecg/JTreeSelect'
-  import moment from 'moment'
-  import UploadToAli from '@femessage/upload-to-ali'
-  import uploadFile from '@/components/uploadFile.vue'
-  export default {
-    name: "YardModal",
-    components: {
-      UploadToAli,
-      JTreeSelect,
-      uploadFile
-    },
-    data() {
-      return {
-        title: "操作",
-        visible: false,
-        model: {},
-        videoUrl: [],
-        imageUrl: [],
-        customDomain: '',
-        region: 'oss-cn-beijing',
-        bucket: 'ctop-media',
-        acceptVideo: 'video/mpeg,video/mp4',
-        acceptImage: 'image/jpeg,image/jpg,image/png',
-        accessKeyId: 'LTAIbNbqWzSOklQV',
-        accessKeySecret: '1rkPz7JNoXk8sJevPaeYHWqfkQXBGh',
-        dateFormat: "YYYY-MM-DD",
-        labelCol: {
-          xs: {span: 24},
-          sm: {span: 5},
-        },
-        wrapperCol: {
-          xs: {span: 24},
-          sm: {span: 16},
-        },
+import { httpAction } from '@/api/manage'
+import pick from 'lodash.pick'
+import JTreeSelect from '@/components/jeecg/JTreeSelect'
+import moment from 'moment'
+import UploadToAli from '@femessage/upload-to-ali'
+import uploadFile from '@/components/uploadFile.vue'
+export default {
+  name: 'YardModal',
+  components: {
+    UploadToAli,
+    JTreeSelect,
+    uploadFile,
+  },
+  data() {
+    return {
+      title: '操作',
+      visible: false,
+      model: {},
+      videoUrl: [],
+      imageUrl: [],
+      customDomain: '',
+      region: 'oss-cn-beijing',
+      bucket: 'ctop-media',
+      acceptVideo: 'video/mpeg,video/mp4',
+      acceptImage: 'image/jpeg,image/jpg,image/png',
+      accessKeyId: 'LTAIbNbqWzSOklQV',
+      accessKeySecret: '1rkPz7JNoXk8sJevPaeYHWqfkQXBGh',
+      dateFormat: 'YYYY-MM-DD',
+      labelCol: {
+        xs: { span: 24 },
+        sm: { span: 5 },
+      },
+      wrapperCol: {
+        xs: { span: 24 },
+        sm: { span: 16 },
+      },
 
-        confirmLoading: false,
-        form: this.$form.createForm(this),
+      confirmLoading: false,
+      form: this.$form.createForm(this),
 
-        url: {
-          add: "/ctop/yard/add",
-          edit: "/ctop/yard/edit",
-        },
-      }
+      url: {
+        add: '/ctop/yard/add',
+        edit: '/ctop/yard/edit',
+      },
+    }
+  },
+  created() {},
+  methods: {
+    add() {
+      this.edit({})
     },
-    created() {
+    edit(record) {
+      let that = this
+      that.form.resetFields()
+      that.model = Object.assign({}, record)
+      that.visible = true
+      this.imageUrl = record.imageUrl ? record.imageUrl : []
+      this.videoUrl = record.videoUrl ? record.videoUrl : []
+      that.$nextTick(() => {
+        that.form.setFieldsValue(pick(this.model, 'buildingName', 'contactName', 'contactMobile', 'address', 'remark'))
+        //时间格式化
+      })
     },
-    methods: {
-      add() {
-        this.edit({});
-      },
-      edit(record) {
+    close() {
+      this.$emit('close')
+      this.visible = false
+    },
+    moment,
+    handleOk() {
+      const that = this
+      // 触发表单验证
+      this.form.validateFields((err, values) => {
+        if (!err) {
+          that.confirmLoading = true
+          let httpurl = ''
+          let method = ''
+          if (!this.model.id) {
+            httpurl += this.url.add
+            method = 'post'
+          } else {
+            httpurl += this.url.edit
+            method = 'put'
+          }
 
-        let that = this;
-        that.form.resetFields();
-        that.model = Object.assign({}, record);
-        that.visible = true;
-        that.$nextTick(() => {
-          that.form.setFieldsValue(pick(this.model, 'buildingName', 'contactName', 'contactMobile','address','remark','imageUrl','videoUrl'))
+          values.imageUrl = this.imageUrl
+          values.videoUrl = this.videoUrl
+          values.coverUrl = this.imageUrl[0]
+          let formData = Object.assign(this.model, values)
           //时间格式化
-        });
-
-      },
-      close() {
-        this.$emit('close');
-        this.visible = false;
-      },
-      moment,
-      handleOk() {
-        const that = this;
-        // 触发表单验证
-        this.form.validateFields((err, values) => {
-          if (!err) {
-            that.confirmLoading = true;
-            let httpurl = '';
-            let method = '';
-            if (!this.model.id) {
-              httpurl += this.url.add;
-              method = 'post';
-            } else {
-              httpurl += this.url.edit;
-              method = 'put';
-            }
 
-            values.imageUrl = this.imageUrl;
-            values.videoUrl = this.videoUrl;
-            let formData = Object.assign(this.model, values);
-            //时间格式化
-
-            console.log(formData)
-            httpAction(httpurl, formData, method).then((res) => {
+          console.log(formData)
+          httpAction(httpurl, formData, method)
+            .then((res) => {
               if (res.success) {
-                that.$message.success(res.message);
-                that.$emit('ok');
+                that.$message.success(res.message)
+                that.$emit('ok')
               } else {
-                that.$message.warning(res.message);
+                that.$message.warning(res.message)
               }
-            }).finally(() => {
-              that.confirmLoading = false;
-              that.close();
             })
-
-
-          }
-        })
-      },
-      handleCancel() {
-        this.close()
-      },
-
-
-    }
-  }
+            .finally(() => {
+              that.confirmLoading = false
+              that.close()
+            })
+        }
+      })
+    },
+    handleCancel() {
+      this.close()
+    },
+  },
+}
 </script>
 
 <style lang="less" scoped>
-
 </style>

+ 0 - 2
src/views/modules/yard/modules/yardDetail.vue

@@ -149,11 +149,9 @@ import {
 } from '@/api/actor'
 import UploadToAli from '@femessage/upload-to-ali'
 import uploadFile from '@/components/uploadFile.vue'
-import { JeecgListMixin } from '@/mixins/JeecgListMixin'
 import { closeAllVideoFun } from '@/utils/videoControl'
 export default {
   name: 'VmCard',
-  mixins: [JeecgListMixin],
   components: {
     UploadToAli,
     uploadFile

+ 2 - 2
vue.config.js

@@ -79,10 +79,10 @@ module.exports = {
         // target: 'http://192.168.0.252:8098', //请求本地 需要jeecg-boot后台项目  毕洁泉
         
 
-        target: 'http://192.168.1.219:8080', //请求本地 需要jeecg-boot后台项目  赵西安
+        // target: 'http://192.168.1.219:8080', //请求本地 需要jeecg-boot后台项目  赵西安
 
 
-        //  target: 'http://api.tjyourong.com.cn', //请求本地 需要jeecg-boot后台项目
+         target: 'http://api.tjyourong.com.cn', //请求本地 需要jeecg-boot后台项目
         // target: 'https://trac.tjyourong.com.cn', //请求本地 需要jeecg-boot后台项目
         // target: 'http://39.106.184.70:8088/', //请求本地 需要jeecg-boot后台项目
         //  target: 'http://adsp.tjyourong.com.cn/', //请求本地 需要jeecg-boot后台项目