Compare commits
No commits in common. "6afa3f267e397946a34f0a155d7867fcafd10372" and "556bcb532071675bad8387c1c3a5297a3c53617f" have entirely different histories.
6afa3f267e
...
556bcb5320
@ -1,24 +1,88 @@
|
||||
<template>
|
||||
<span>
|
||||
<template v-for="(dict, index) in this.getDictDatas2(type, value)">
|
||||
<!-- 默认样式 -->
|
||||
<span v-if="dict.colorType === 'default' || dict.colorType === '' || dict.colorType === undefined" :key="dict.value" :index="index"
|
||||
:class="dict.cssClass">{{ dict.label }}</span>
|
||||
<!-- Tag 样式 -->
|
||||
<el-tag v-else :disable-transitions="true" :key="dict.value" :index="index" :type="dict.colorType" :class="dict.cssClass">
|
||||
{{ dict.label }}
|
||||
</el-tag>
|
||||
<div>
|
||||
<template v-for="(item, index) in options">
|
||||
<template v-if="values.includes(item.value)">
|
||||
<span
|
||||
v-if="item.listClass == 'default' || item.listClass == ''"
|
||||
:key="item.value"
|
||||
:index="index"
|
||||
:class="item.cssClass"
|
||||
>{{ item.label + " " }}</span
|
||||
>
|
||||
<el-tag
|
||||
v-else
|
||||
:disable-transitions="true"
|
||||
:key="item.value"
|
||||
:index="index"
|
||||
:type="item.listClass == 'primary' ? '' : item.listClass"
|
||||
:class="item.cssClass"
|
||||
>
|
||||
{{ item.label + " " }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</template>
|
||||
</span>
|
||||
<template v-if="unmatch && showValue">
|
||||
{{ unmatchArray | handleArray }}
|
||||
</template>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "DictTag",
|
||||
props: {
|
||||
type: String,
|
||||
value: [Number, String, Boolean, Array],
|
||||
options: {
|
||||
type: Array,
|
||||
default: null,
|
||||
},
|
||||
value: [Number, String, Array],
|
||||
// 当未找到匹配的数据时,显示value
|
||||
showValue: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
unmatchArray: [], // 记录未匹配的项
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
values() {
|
||||
if (this.value !== null && typeof this.value !== "undefined") {
|
||||
return Array.isArray(this.value) ? this.value : [String(this.value)];
|
||||
} else {
|
||||
return [];
|
||||
}
|
||||
},
|
||||
unmatch() {
|
||||
this.unmatchArray = [];
|
||||
if (this.value !== null && typeof this.value !== "undefined") {
|
||||
// 传入值为非数组
|
||||
if (!Array.isArray(this.value)) {
|
||||
if (this.options.some((v) => v.value == this.value)) return false;
|
||||
this.unmatchArray.push(this.value);
|
||||
return true;
|
||||
}
|
||||
// 传入值为Array
|
||||
this.value.forEach((item) => {
|
||||
if (!this.options.some((v) => v.value == item))
|
||||
this.unmatchArray.push(item);
|
||||
});
|
||||
return true;
|
||||
}
|
||||
// 没有value不显示
|
||||
return false;
|
||||
},
|
||||
},
|
||||
filters: {
|
||||
handleArray(array) {
|
||||
if (array.length === 0) return "";
|
||||
return array.reduce((pre, cur) => {
|
||||
return pre + " " + cur;
|
||||
})
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
|
@ -1,92 +0,0 @@
|
||||
<template>
|
||||
<div>
|
||||
<template v-for="(item, index) in options">
|
||||
<template v-if="values.includes(item.value)">
|
||||
<span
|
||||
v-if="item.listClass == 'default' || item.listClass == ''"
|
||||
:key="item.value"
|
||||
:index="index"
|
||||
:class="item.cssClass"
|
||||
>{{ item.label + " " }}</span
|
||||
>
|
||||
<el-tag
|
||||
v-else
|
||||
:disable-transitions="true"
|
||||
:key="item.value"
|
||||
:index="index"
|
||||
:type="item.listClass == 'primary' ? '' : item.listClass"
|
||||
:class="item.cssClass"
|
||||
>
|
||||
{{ item.label + " " }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</template>
|
||||
<template v-if="unmatch && showValue">
|
||||
{{ unmatchArray | handleArray }}
|
||||
</template>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "DictTag",
|
||||
props: {
|
||||
options: {
|
||||
type: Array,
|
||||
default: null,
|
||||
},
|
||||
value: [Number, String, Array],
|
||||
// 当未找到匹配的数据时,显示value
|
||||
showValue: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
unmatchArray: [], // 记录未匹配的项
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
values() {
|
||||
if (this.value !== null && typeof this.value !== "undefined") {
|
||||
return Array.isArray(this.value) ? this.value : [String(this.value)];
|
||||
} else {
|
||||
return [];
|
||||
}
|
||||
},
|
||||
unmatch() {
|
||||
this.unmatchArray = [];
|
||||
if (this.value !== null && typeof this.value !== "undefined") {
|
||||
// 传入值为非数组
|
||||
if (!Array.isArray(this.value)) {
|
||||
if (this.options.some((v) => v.value == this.value)) return false;
|
||||
this.unmatchArray.push(this.value);
|
||||
return true;
|
||||
}
|
||||
// 传入值为Array
|
||||
this.value.forEach((item) => {
|
||||
if (!this.options.some((v) => v.value == item))
|
||||
this.unmatchArray.push(item);
|
||||
});
|
||||
return true;
|
||||
}
|
||||
// 没有value不显示
|
||||
return false;
|
||||
},
|
||||
},
|
||||
filters: {
|
||||
handleArray(array) {
|
||||
if (array.length === 0) return "";
|
||||
return array.reduce((pre, cur) => {
|
||||
return pre + " " + cur;
|
||||
})
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
.el-tag + .el-tag {
|
||||
margin-left: 10px;
|
||||
}
|
||||
</style>
|
@ -149,10 +149,8 @@
|
||||
import { getDicts } from '@/api/system/dict/data.js'
|
||||
import request from "@/utils/request";
|
||||
import {parseTime} from "../../../../utils/ruoyi";
|
||||
import DictTag from "@/components/DictTagOld/index.vue";
|
||||
export default {
|
||||
name: "News",
|
||||
components:{DictTag},
|
||||
data() {
|
||||
return {
|
||||
inspection_new_type: [],
|
||||
|
@ -270,11 +270,9 @@
|
||||
import {fjPartners, listMallPartners,} from "../inspection/api/Partner";
|
||||
import { tijiaoshenhe, homeGoods, listInspectionGoods, getInspectionGoods, delInspectionGoods, addInspectionGoods, updateInspectionGoods } from "./api/inspectionGoods";
|
||||
import request from "@/utils/request";
|
||||
import DictTag from "@/components/DictTagOld/index.vue";
|
||||
|
||||
export default {
|
||||
name: "InspectionGoods",
|
||||
components:{DictTag},
|
||||
dicts: ['is_special', 'yes_no'],
|
||||
data() {
|
||||
|
||||
|
@ -281,11 +281,9 @@
|
||||
<script>
|
||||
import { listInsuranceOrder, getInsuranceOrder, delInsuranceOrder, addInsuranceOrder, updateInsuranceOrder } from "@/api/system/insuranceOrder";
|
||||
import request from "@/utils/request";
|
||||
import DictTag from "@/components/DictTagOld/index.vue";
|
||||
|
||||
export default {
|
||||
name: "InsuranceOrder",
|
||||
components:{DictTag},
|
||||
dicts: ['comment_star', 'order_status'],
|
||||
data() {
|
||||
return {
|
||||
|
@ -301,11 +301,9 @@
|
||||
<script>
|
||||
import { listCustomerInfo, getCustomerInfo, delCustomerInfo, addCustomerInfo, updateCustomerInfo } from "./api/customer";
|
||||
import request from "@/utils/request";
|
||||
import DictTag from '@/components/DictTagOld/index.vue'
|
||||
|
||||
export default {
|
||||
name: "CustomerInfo",
|
||||
components:{DictTag},
|
||||
dicts: ['sys_user_sex','jcz_role'],
|
||||
data() {
|
||||
return {
|
||||
|
@ -285,11 +285,9 @@
|
||||
import print from 'vue-print-nb'
|
||||
import moment from 'moment';
|
||||
import request from "@/utils/request";
|
||||
import DictTag from "@/components/DictTagOld/index.vue";
|
||||
|
||||
export default {
|
||||
name: "Info",
|
||||
components:{DictTag},
|
||||
dicts: ['customer_source','pay_type','car_status','car_use_nature','inspection_use_role'],
|
||||
directives: {
|
||||
print
|
||||
|
@ -192,10 +192,8 @@
|
||||
import { listInfo, getInfo, delInfo, addInfo, updateInfo } from "./api/ordermanagement";
|
||||
import moment from 'moment';
|
||||
import request from "@/utils/request";
|
||||
import DictTag from "@/components/DictTagOld/index.vue";
|
||||
export default {
|
||||
name: "Info",
|
||||
components:{DictTag},
|
||||
dicts: ['order_status', 'all_order_type'],
|
||||
data() {
|
||||
return {
|
||||
|
@ -278,11 +278,10 @@
|
||||
import {editSkuPrice,shangxiajia,categoryList,goodsDetail, shopInfo, tijiaoshenhe, homeGoods, listInspectionGoods, getInspectionGoods, delInspectionGoods, addInspectionGoods, updateInspectionGoods } from "./api/shopadministration.js";
|
||||
import request from "@/utils/request";
|
||||
import Editor from "@/components/Editor/index.vue";
|
||||
import DictTag from "@/components/DictTagOld/index.vue";
|
||||
|
||||
export default {
|
||||
name: "InspectionGoods",
|
||||
components: {Editor,DictTag},
|
||||
components: {Editor},
|
||||
dicts: ['is_special', 'yes_no'],
|
||||
data() {
|
||||
|
||||
|
@ -357,7 +357,6 @@
|
||||
import print from 'vue-print-nb'
|
||||
import moment from 'moment';
|
||||
import request from "@/utils/request";
|
||||
import DictTag from "@/components/DictTagOld/index.vue";
|
||||
|
||||
export default {
|
||||
name: "Info",
|
||||
@ -365,7 +364,6 @@
|
||||
directives: {
|
||||
print
|
||||
},
|
||||
components:{DictTag},
|
||||
data() {
|
||||
return {
|
||||
moneyData:{
|
||||
|
Loading…
Reference in New Issue
Block a user