Merge branch 'master' of http://gitea.zianxin.com/zianxin-tec/biz-pc-cloud
This commit is contained in:
commit
d10ba485a6
4 files changed
+116
No files matched your search
@@ -1,5 +1,18 @@
|
|||||||
import request from "/@/utils/request"
|
import request from "/@/utils/request"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 刷新智能柜货柜二维码
|
||||||
|
* @param hardDoorId 柜子编号
|
||||||
|
* @param cabinetNo 货柜编号
|
||||||
|
*/
|
||||||
|
export function refreshQrCode(params?: { hardDoorId: any; cabinetNo: any }) {
|
||||||
|
return request({
|
||||||
|
url: "/hard/hard-door-manager/refresh-qr-code",
|
||||||
|
method: "get",
|
||||||
|
params,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 音量修改
|
* 音量修改
|
||||||
* @param hardId 设备id
|
* @param hardId 设备id
|
||||||
|
|||||||
@@ -0,0 +1,98 @@
|
|||||||
|
<template>
|
||||||
|
<el-select
|
||||||
|
style="width: 100%"
|
||||||
|
v-model="state.selectId"
|
||||||
|
:placeholder="props.placeholder"
|
||||||
|
clearable
|
||||||
|
remote-show-suffix
|
||||||
|
filterable
|
||||||
|
remote
|
||||||
|
:disabled="props.disabled"
|
||||||
|
:remote-method="remoteSearch"
|
||||||
|
:loading="state.loading"
|
||||||
|
@visible-change="(e: boolean) => e && getOptions()"
|
||||||
|
>
|
||||||
|
<el-option v-for="v in state.options" :key="v.roleId" :label="`${v.roleName}`" :value="v.roleId">
|
||||||
|
<div class="flex items-center">
|
||||||
|
<div class="color-primary">{{ v.roleName }}</div>
|
||||||
|
</div>
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts" name="select-role">
|
||||||
|
import { reactive } from "vue"
|
||||||
|
import * as roleApi from "/@/api/admin/role"
|
||||||
|
|
||||||
|
const selectId = defineModel()
|
||||||
|
|
||||||
|
const props = withDefaults(
|
||||||
|
defineProps<{
|
||||||
|
placeholder?: string
|
||||||
|
apiParams?: any
|
||||||
|
autoFirst?: boolean
|
||||||
|
disabled?: boolean
|
||||||
|
}>(),
|
||||||
|
{
|
||||||
|
placeholder: "请选择",
|
||||||
|
apiParams: {},
|
||||||
|
autoFirst: false,
|
||||||
|
disabled: false,
|
||||||
|
},
|
||||||
|
)
|
||||||
|
|
||||||
|
const queryForm = reactive<any>({
|
||||||
|
roleName: null,
|
||||||
|
current: 1,
|
||||||
|
size: 10,
|
||||||
|
})
|
||||||
|
|
||||||
|
const state = reactive<any>({
|
||||||
|
loading: true,
|
||||||
|
selectId: selectId,
|
||||||
|
options: [],
|
||||||
|
})
|
||||||
|
|
||||||
|
watch(
|
||||||
|
selectId,
|
||||||
|
(newVal, oldValue) => {
|
||||||
|
if (newVal == oldValue) return
|
||||||
|
state.selectId = newVal
|
||||||
|
getOptions()
|
||||||
|
},
|
||||||
|
{ immediate: true },
|
||||||
|
)
|
||||||
|
|
||||||
|
async function getOptions() {
|
||||||
|
try {
|
||||||
|
state.loading = true
|
||||||
|
const _pa = {
|
||||||
|
...queryForm,
|
||||||
|
...props.apiParams,
|
||||||
|
}
|
||||||
|
const { data } = await roleApi.pageList(_pa)
|
||||||
|
state.options = data.records ?? []
|
||||||
|
if (props.autoFirst && state.options.length != 0) {
|
||||||
|
state.selectId = state.options[0].id
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
|
setTimeout(() => (state.loading = false), 500)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function remoteSearch(params: string) {
|
||||||
|
if (params != queryForm.roleName) {
|
||||||
|
queryForm.roleName = params
|
||||||
|
getOptions()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function clear() {
|
||||||
|
state.selectId = null
|
||||||
|
getOptions()
|
||||||
|
}
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
props.autoFirst && getOptions()
|
||||||
|
})
|
||||||
|
</script>
|
||||||
@@ -30,6 +30,7 @@ import SelectHardSpuCategory from "/@/components/Select/SelectHardSpuCategory.vu
|
|||||||
import SelectHard from "/@/components/Select/SelectHard.vue"
|
import SelectHard from "/@/components/Select/SelectHard.vue"
|
||||||
import SelectHardSpu from "/@/components/Select/SelectHardSpu.vue"
|
import SelectHardSpu from "/@/components/Select/SelectHardSpu.vue"
|
||||||
import SelectHardGroup from "/@/components/Select/selectHardGroup.vue"
|
import SelectHardGroup from "/@/components/Select/selectHardGroup.vue"
|
||||||
|
import SelectRole from "/@/components/Select/SelectRole.vue"
|
||||||
|
|
||||||
// 第三方组件
|
// 第三方组件
|
||||||
import ElementPlus from "element-plus"
|
import ElementPlus from "element-plus"
|
||||||
@@ -81,6 +82,7 @@ export default {
|
|||||||
app.component("SelectHandlerUser", SelectHandlerUser)
|
app.component("SelectHandlerUser", SelectHandlerUser)
|
||||||
app.component("SelectSupplier", SelectSupplier)
|
app.component("SelectSupplier", SelectSupplier)
|
||||||
app.component("SelectMchRule", SelectMchRule)
|
app.component("SelectMchRule", SelectMchRule)
|
||||||
|
app.component("SelectRole", SelectRole)
|
||||||
|
|
||||||
// 导入全部的elmenet-plus的图标
|
// 导入全部的elmenet-plus的图标
|
||||||
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
|
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
|
||||||
|
|||||||
@@ -26,6 +26,9 @@
|
|||||||
<el-form-item style="width: 250px" label="部门" prop="deptId">
|
<el-form-item style="width: 250px" label="部门" prop="deptId">
|
||||||
<select-dept v-model="state.queryForm.deptId" clearable />
|
<select-dept v-model="state.queryForm.deptId" clearable />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item style="width: 250px" label="角色" prop="role">
|
||||||
|
<select-role v-model="state.queryForm.role" clearable />
|
||||||
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button icon="Search" type="primary" @click="getDataList">查询</el-button>
|
<el-button icon="Search" type="primary" @click="getDataList">查询</el-button>
|
||||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||||
|
|||||||
Reference in new issue
Block a user