4 changed files with 143 additions and 12 deletions
			
			
		@ -0,0 +1,24 @@
					 | 
				
			||||
import request from '@/utils/request' | 
				
			||||
 | 
				
			||||
export const InspectionsApi = { | 
				
			||||
	/** | 
				
			||||
	 * 获取列表 | 
				
			||||
	 * @param {Object} params | 
				
			||||
	 */ | 
				
			||||
	getList: (params) => { | 
				
			||||
		return request({ | 
				
			||||
			url: `/system/enterprise-inspections/page`, | 
				
			||||
			method: 'GET', | 
				
			||||
			params | 
				
			||||
		}) | 
				
			||||
	}, | 
				
			||||
	/** | 
				
			||||
	 * 获取详情 | 
				
			||||
	 */ | 
				
			||||
	getDetail: (id) => { | 
				
			||||
		return request({ | 
				
			||||
			url: `/system/enterprise-inspections/appGet?id=${id}`, | 
				
			||||
			method: 'GET', | 
				
			||||
		}) | 
				
			||||
	} | 
				
			||||
} | 
				
			||||
@ -0,0 +1,25 @@
					 | 
				
			||||
import request from '@/utils/request' | 
				
			||||
 | 
				
			||||
 | 
				
			||||
export const TaskApi = { | 
				
			||||
	/** | 
				
			||||
	 * 获取列表 | 
				
			||||
	 * @param {Object} params | 
				
			||||
	 */ | 
				
			||||
	getList: (params) => { | 
				
			||||
		return request({ | 
				
			||||
			url: `/system/task-info/appPage`, | 
				
			||||
			method: 'GET', | 
				
			||||
			params | 
				
			||||
		}) | 
				
			||||
	}, | 
				
			||||
	/** | 
				
			||||
	 * 获取详情 | 
				
			||||
	 */ | 
				
			||||
	getDetail: (id) => { | 
				
			||||
		return request({ | 
				
			||||
			url: `/system/task-info/appGet?id=${id}`, | 
				
			||||
			method: 'GET', | 
				
			||||
		}) | 
				
			||||
	} | 
				
			||||
} | 
				
			||||
@ -0,0 +1,87 @@
					 | 
				
			||||
<template> | 
				
			||||
  <view :class="[getClass, 'dict-tag']">{{ current.label }}</view> | 
				
			||||
</template> | 
				
			||||
 | 
				
			||||
<script> | 
				
			||||
export default { | 
				
			||||
  name: 'cs-dictTag', | 
				
			||||
  data() { | 
				
			||||
    return { | 
				
			||||
      current: {} | 
				
			||||
    } | 
				
			||||
  }, | 
				
			||||
  computed: { | 
				
			||||
    getClass() { | 
				
			||||
      return this.current?.colorType || 'info' | 
				
			||||
    } | 
				
			||||
  }, | 
				
			||||
  props: { | 
				
			||||
    dict: { | 
				
			||||
      type: Array, | 
				
			||||
      required: true, | 
				
			||||
      default: () => { | 
				
			||||
        return [] | 
				
			||||
      } | 
				
			||||
    }, | 
				
			||||
    value: { | 
				
			||||
      type: Number, | 
				
			||||
      required: true | 
				
			||||
    } | 
				
			||||
  }, | 
				
			||||
  watch: { | 
				
			||||
    '$props.value': { | 
				
			||||
      handler: function (v) { | 
				
			||||
        if (v) { | 
				
			||||
          this.getDickObj() | 
				
			||||
        } | 
				
			||||
      }, | 
				
			||||
      deep: true, | 
				
			||||
      immediate: true | 
				
			||||
    }, | 
				
			||||
    '$props.dict': { | 
				
			||||
      handler: function (v) { | 
				
			||||
        if (v) { | 
				
			||||
          this.getDickObj() | 
				
			||||
        } | 
				
			||||
      }, | 
				
			||||
      deep: true, | 
				
			||||
      immediate: true | 
				
			||||
    } | 
				
			||||
  }, | 
				
			||||
  mounted() {}, | 
				
			||||
  methods: { | 
				
			||||
    getDickObj() { | 
				
			||||
      this.current = this.$props.dict.find(i => i.value == this.$props.value) | 
				
			||||
    } | 
				
			||||
  } | 
				
			||||
} | 
				
			||||
</script> | 
				
			||||
 | 
				
			||||
<style lang="scss" scoped> | 
				
			||||
.success { | 
				
			||||
  color: #17c653; | 
				
			||||
  background-color: #eafff1; | 
				
			||||
} | 
				
			||||
.primary { | 
				
			||||
  color: $uni-color-primary; | 
				
			||||
  background-color: rgba($uni-color-primary, 0.2); | 
				
			||||
} | 
				
			||||
.warning { | 
				
			||||
  color: #f6b100; | 
				
			||||
  background-color: #fff8dd; | 
				
			||||
} | 
				
			||||
.error { | 
				
			||||
  color: #f8285a; | 
				
			||||
  background-color: #ffeef3; | 
				
			||||
} | 
				
			||||
.info { | 
				
			||||
  background-color: #f1f1f4; | 
				
			||||
  color: #99a1b7; | 
				
			||||
} | 
				
			||||
.dict-tag { | 
				
			||||
  min-width: 100px; | 
				
			||||
  text-align: center; | 
				
			||||
  font-size: 12px; | 
				
			||||
  padding: 4px 20px; | 
				
			||||
} | 
				
			||||
</style> | 
				
			||||
					Loading…
					
					
				
		Reference in new issue