dict tag
This commit is contained in:
@ -5,19 +5,21 @@
|
||||
<span
|
||||
v-if="item.elTagType == 'default' || item.elTagType == ''"
|
||||
:key="item.value"
|
||||
:index="index"
|
||||
:class="item.elTagClass"
|
||||
:index="index"
|
||||
>{{ item.label }}</span
|
||||
>
|
||||
<el-tag
|
||||
v-else
|
||||
:disable-transitions="true"
|
||||
:key="item.value + ''"
|
||||
:index="index"
|
||||
:type="item.elTagType === 'primary' ? '' : item.elTagType"
|
||||
:class="item.elTagClass"
|
||||
>{{ item.label }}</el-tag
|
||||
>
|
||||
:disable-transitions="true"
|
||||
:effect="effect"
|
||||
:index="index"
|
||||
:size="size"
|
||||
:type="item.elTagType === 'primary' ? '' : item.elTagType"
|
||||
>{{ item.label }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</template>
|
||||
</div>
|
||||
@ -32,6 +34,14 @@ const props = defineProps({
|
||||
},
|
||||
// 当前的值
|
||||
value: [Number, String, Array],
|
||||
effect: {
|
||||
type: String,
|
||||
default: "light",
|
||||
},
|
||||
size: {
|
||||
type: String,
|
||||
default: "default",
|
||||
},
|
||||
});
|
||||
|
||||
const values = computed(() => {
|
||||
|
||||
@ -6,11 +6,13 @@
|
||||
<el-table-column prop="deviceId" />
|
||||
<el-table-column label="设备名称" prop="deviceName" />
|
||||
</el-table>
|
||||
<pagination v-show="total > 0"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
v-model:page="queryParams.pageNum"
|
||||
:total="total"
|
||||
@pagination="getList" />
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
v-model:page="queryParams.pageNum"
|
||||
:total="total"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col>
|
||||
@ -28,22 +30,25 @@ import Pagination from "@/components/Pagination/index.vue";
|
||||
const props = defineProps({
|
||||
list: {
|
||||
type: Array,
|
||||
default: [{
|
||||
deviceId: 40
|
||||
}, {
|
||||
deviceId: 38
|
||||
}]
|
||||
default: [
|
||||
{
|
||||
deviceId: 40,
|
||||
},
|
||||
{
|
||||
deviceId: 38,
|
||||
},
|
||||
],
|
||||
},
|
||||
requestMethod: {
|
||||
type: Function,
|
||||
required: true
|
||||
required: true,
|
||||
},
|
||||
selectKey: {
|
||||
required: true
|
||||
required: true,
|
||||
},
|
||||
modelValue: {
|
||||
type: Boolean
|
||||
}
|
||||
type: Boolean,
|
||||
},
|
||||
});
|
||||
const { list } = toRefs(props);
|
||||
|
||||
@ -58,8 +63,8 @@ const ids = ref([]);
|
||||
const data = reactive({
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10
|
||||
}
|
||||
pageSize: 10,
|
||||
},
|
||||
});
|
||||
|
||||
const { queryParams } = toRefs(data);
|
||||
@ -89,11 +94,14 @@ const cancel = () => {
|
||||
|
||||
const handleSelect = (selection, row) => {
|
||||
const isCheck =
|
||||
selection.findIndex((el) => el[props.selectKey] === row[props.selectKey]) > -1;
|
||||
selection.findIndex((el) => el[props.selectKey] === row[props.selectKey]) >
|
||||
-1;
|
||||
if (isCheck) {
|
||||
/*添加选中*/
|
||||
const isIdNotExist =
|
||||
list.value.findIndex((el) => el[props.selectKey] === row[props.selectKey]) === -1;
|
||||
list.value.findIndex(
|
||||
(el) => el[props.selectKey] === row[props.selectKey]
|
||||
) === -1;
|
||||
if (isIdNotExist) {
|
||||
selectedProperties.value.push(row);
|
||||
}
|
||||
@ -127,6 +135,4 @@ const confirmSelect = () => {
|
||||
getList();
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
<style scoped></style>
|
||||
|
||||
@ -70,7 +70,7 @@
|
||||
</template>
|
||||
<script setup>
|
||||
import { reactive, toRefs, watch } from "vue";
|
||||
import { listUser } from "@/api/system/user";
|
||||
import { listUser } from "@/api/system/user";
|
||||
import { addDateRange } from "@/utils/ruoyi";
|
||||
import { deptTreeSelect } from "@/api/system/dept";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user