Merge branch 'master' of http://124.223.211.244:8418/zianxin/biz-pc-cloud
This commit is contained in:
commit
20637dc1a9
19 files changed
+615
-179
No files matched your search
+1
-1
@@ -20,4 +20,4 @@ VITE_ADMIN_PROXY_PATH = http://192.168.101.29:9999/ # 邓-本地
|
||||
VITE_IMAGE_BASE_PATH = http://192.168.101.29:9999 # 邓-本地
|
||||
|
||||
# 代码生成服务地址
|
||||
VITE_GEN_PROXY_PATH = http://192.168.110.156:5003
|
||||
VITE_GEN_PROXY_PATH = http://192.168.110.156:5003
|
||||
+61
-60
@@ -1,94 +1,95 @@
|
||||
import request from '/@/utils/request';
|
||||
import request from "/@/utils/request"
|
||||
|
||||
export const list = () => {
|
||||
return request({
|
||||
url: '/admin/user/list',
|
||||
method: 'get',
|
||||
});
|
||||
};
|
||||
url: "/admin/user/list",
|
||||
method: "get",
|
||||
})
|
||||
}
|
||||
|
||||
export const pageList = (params?: Object) => {
|
||||
return request({
|
||||
url: '/admin/user/page',
|
||||
method: 'get',
|
||||
url: "/admin/user/page",
|
||||
method: "get",
|
||||
params,
|
||||
});
|
||||
};
|
||||
})
|
||||
}
|
||||
|
||||
export const addObj = (obj: Object) => {
|
||||
return request({
|
||||
url: '/admin/user',
|
||||
method: 'post',
|
||||
url: "/admin/user",
|
||||
method: "post",
|
||||
data: obj,
|
||||
});
|
||||
};
|
||||
})
|
||||
}
|
||||
|
||||
export const getObj = (id: String) => {
|
||||
return request({
|
||||
url: '/admin/user/details/' + id,
|
||||
method: 'get',
|
||||
});
|
||||
};
|
||||
url: "/admin/user/details/" + id,
|
||||
method: "get",
|
||||
})
|
||||
}
|
||||
|
||||
export const delObj = (ids: Object) => {
|
||||
return request({
|
||||
url: '/admin/user',
|
||||
method: 'delete',
|
||||
url: "/admin/user",
|
||||
method: "delete",
|
||||
data: ids,
|
||||
});
|
||||
};
|
||||
})
|
||||
}
|
||||
|
||||
export const putObj = (obj: Object) => {
|
||||
return request({
|
||||
url: '/admin/user',
|
||||
method: 'put',
|
||||
url: "/admin/user",
|
||||
method: "put",
|
||||
data: obj,
|
||||
});
|
||||
};
|
||||
})
|
||||
}
|
||||
|
||||
export function getDetails(obj: Object) {
|
||||
return request({
|
||||
url: '/admin/user/details',
|
||||
method: 'get',
|
||||
url: "/admin/user/details",
|
||||
method: "get",
|
||||
params: obj,
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
// 更改个人信息
|
||||
export function editInfo(obj: Object) {
|
||||
return request({
|
||||
url: '/admin/user/personal/edit',
|
||||
method: 'put',
|
||||
url: "/admin/user/personal/edit",
|
||||
method: "put",
|
||||
data: obj,
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
// 更改个人密码
|
||||
export function password(obj: Object) {
|
||||
return request({
|
||||
url: '/admin/user/personal/password',
|
||||
method: 'put',
|
||||
url: "/admin/user/personal/password",
|
||||
method: "put",
|
||||
data: obj,
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
export function unbindingUser(type) {
|
||||
return request({
|
||||
url: '/admin/user/unbinding',
|
||||
method: 'post',
|
||||
url: "/admin/user/unbinding",
|
||||
method: "post",
|
||||
params: {
|
||||
type,
|
||||
},
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
export function checkPassword(password: string) {
|
||||
return request({
|
||||
url: '/admin/user/check',
|
||||
method: 'post',
|
||||
url: "/admin/user/check",
|
||||
method: "post",
|
||||
params: {
|
||||
password,
|
||||
},
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -96,50 +97,50 @@ export function checkPassword(password: string) {
|
||||
*/
|
||||
export const registerUser = (userInfo: object) => {
|
||||
return request({
|
||||
url: '/admin/register/user',
|
||||
method: 'post',
|
||||
url: "/admin/register/user",
|
||||
method: "post",
|
||||
data: userInfo,
|
||||
});
|
||||
};
|
||||
})
|
||||
}
|
||||
|
||||
export const resetUserPassword = (userInfo: object) => {
|
||||
return request({
|
||||
url: '/admin/register/password',
|
||||
method: 'post',
|
||||
url: "/admin/register/password",
|
||||
method: "post",
|
||||
data: userInfo,
|
||||
});
|
||||
};
|
||||
})
|
||||
}
|
||||
|
||||
export function validateUsername(rule: any, value: any, callback: any, isEdit: boolean) {
|
||||
const flag = new RegExp(/^([a-z\d]+?)$/).test(value);
|
||||
const flag = new RegExp(/^([a-z\d]+?)$/).test(value)
|
||||
if (!flag) {
|
||||
callback(new Error('用户名支持小写英文、数字'));
|
||||
callback(new Error("用户名支持小写英文、数字"))
|
||||
}
|
||||
|
||||
if (isEdit) {
|
||||
return callback();
|
||||
return callback()
|
||||
}
|
||||
|
||||
getDetails({ username: value }).then((response) => {
|
||||
const result = response.data;
|
||||
const result = response.data
|
||||
if (result !== null) {
|
||||
callback(new Error('用户名已经存在'));
|
||||
callback(new Error("用户名已经存在"))
|
||||
} else {
|
||||
callback();
|
||||
callback()
|
||||
}
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
export function validatePhone(rule: any, value: any, callback: any, isEdit: boolean) {
|
||||
if (isEdit) {
|
||||
return callback();
|
||||
return callback()
|
||||
}
|
||||
getDetails({ phone: value }).then((response) => {
|
||||
const result = response.data;
|
||||
const result = response.data
|
||||
if (result !== null) {
|
||||
callback(new Error('手机号已经存在'));
|
||||
callback(new Error("手机号已经存在"))
|
||||
} else {
|
||||
callback();
|
||||
callback()
|
||||
}
|
||||
});
|
||||
})
|
||||
}
|
||||
+37
-30
@@ -1,49 +1,56 @@
|
||||
import request from "/@/utils/request"
|
||||
|
||||
export const putGlobalFace = (obj: Object) => {
|
||||
return request({
|
||||
url: "/admin/user-face/global-face",
|
||||
method: "post",
|
||||
data: obj,
|
||||
})
|
||||
}
|
||||
|
||||
export function pageJoin(query?: Object) {
|
||||
return request({
|
||||
url: '/admin/user-face/page-join',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
return request({
|
||||
url: "/admin/user-face/page-join",
|
||||
method: "get",
|
||||
params: query,
|
||||
})
|
||||
}
|
||||
|
||||
export function fetchList(query?: Object) {
|
||||
return request({
|
||||
url: '/admin/user-face/page',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
return request({
|
||||
url: "/admin/user-face/page",
|
||||
method: "get",
|
||||
params: query,
|
||||
})
|
||||
}
|
||||
|
||||
export function addObj(obj?: Object) {
|
||||
return request({
|
||||
url: '/admin/user-face',
|
||||
method: 'post',
|
||||
data: obj
|
||||
})
|
||||
return request({
|
||||
url: "/admin/user-face",
|
||||
method: "post",
|
||||
data: obj,
|
||||
})
|
||||
}
|
||||
|
||||
export function getObj(id?: string) {
|
||||
return request({
|
||||
url: '/admin/user-face/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
return request({
|
||||
url: "/admin/user-face/" + id,
|
||||
method: "get",
|
||||
})
|
||||
}
|
||||
|
||||
export function delObjs(ids?: Object) {
|
||||
return request({
|
||||
url: '/admin/user-face',
|
||||
method: 'delete',
|
||||
data: ids
|
||||
})
|
||||
return request({
|
||||
url: "/admin/user-face",
|
||||
method: "delete",
|
||||
data: ids,
|
||||
})
|
||||
}
|
||||
|
||||
export function putObj(obj?: Object) {
|
||||
return request({
|
||||
url: '/admin/user-face',
|
||||
method: 'put',
|
||||
data: obj
|
||||
})
|
||||
return request({
|
||||
url: "/admin/user-face",
|
||||
method: "put",
|
||||
data: obj,
|
||||
})
|
||||
}
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
import request from "/@/utils/request"
|
||||
|
||||
export function pageJoin(query?: Object) {
|
||||
return request({
|
||||
url: "/hard/hard-group/page-join",
|
||||
method: "get",
|
||||
params: query,
|
||||
})
|
||||
}
|
||||
|
||||
export function fetchList(query?: Object) {
|
||||
return request({
|
||||
url: "/hard/hard-group/page",
|
||||
method: "get",
|
||||
params: query,
|
||||
})
|
||||
}
|
||||
|
||||
export function addObj(obj?: Object) {
|
||||
return request({
|
||||
url: "/hard/hard-group",
|
||||
method: "post",
|
||||
data: obj,
|
||||
})
|
||||
}
|
||||
|
||||
export function getObj(id?: string) {
|
||||
return request({
|
||||
url: "/hard/hard-group/" + id,
|
||||
method: "get",
|
||||
})
|
||||
}
|
||||
|
||||
export function delObjs(ids?: Object) {
|
||||
return request({
|
||||
url: "/hard/hard-group",
|
||||
method: "delete",
|
||||
data: ids,
|
||||
})
|
||||
}
|
||||
|
||||
export function putObj(obj?: Object) {
|
||||
return request({
|
||||
url: "/hard/hard-group",
|
||||
method: "put",
|
||||
data: obj,
|
||||
})
|
||||
}
|
||||
@@ -22,14 +22,14 @@
|
||||
<el-button circle icon="Refresh" @click="handleRefresh()" />
|
||||
</el-tooltip>
|
||||
|
||||
<!-- 插槽 -->
|
||||
<slot></slot>
|
||||
</el-row>
|
||||
<!-- 插槽 -->
|
||||
<slot></slot>
|
||||
</el-row>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="right-toolbar">
|
||||
import { auth } from '/@/utils/authFunction';
|
||||
import { auth } from "/@/utils/authFunction"
|
||||
|
||||
/**
|
||||
* 通过 defineProps 函数定义组件 props
|
||||
@@ -63,43 +63,43 @@ const props = defineProps({
|
||||
type: Number,
|
||||
default: 10,
|
||||
},
|
||||
});
|
||||
})
|
||||
|
||||
const emits = defineEmits(['update:showSearch', 'queryTable', 'exportExcel']);
|
||||
const emits = defineEmits(["update:showSearch", "queryTable", "exportExcel"])
|
||||
|
||||
const style = computed(() => {
|
||||
const ret = {};
|
||||
const ret = {}
|
||||
// 如果props中有传入gutter属性,则计算出marginRight
|
||||
if (props.gutter) {
|
||||
ret.marginRight = `${props.gutter / 2}px`;
|
||||
ret.marginRight = `${props.gutter / 2}px`
|
||||
}
|
||||
return ret; // 返回计算后的样式对象
|
||||
});
|
||||
return ret // 返回计算后的样式对象
|
||||
})
|
||||
|
||||
// 搜索
|
||||
const toggleSearch = () => {
|
||||
emits('update:showSearch', !props.showSearch);
|
||||
};
|
||||
emits("update:showSearch", !props.showSearch)
|
||||
}
|
||||
|
||||
// 刷新
|
||||
const handleRefresh = () => {
|
||||
emits('queryTable');
|
||||
};
|
||||
emits("queryTable")
|
||||
}
|
||||
|
||||
// 导出excel
|
||||
const handleExport = () => {
|
||||
emits('exportExcel');
|
||||
};
|
||||
emits("exportExcel")
|
||||
}
|
||||
|
||||
// 是否导出
|
||||
const isExport = () => {
|
||||
if (props.export === true) {
|
||||
return true;
|
||||
return true
|
||||
}
|
||||
|
||||
// 字符串鉴权
|
||||
return props.export && auth(props.export);
|
||||
};
|
||||
return props.export && auth(props.export)
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
@@ -0,0 +1,81 @@
|
||||
<template>
|
||||
<el-select
|
||||
style="width: 100%"
|
||||
v-model="state.selectId"
|
||||
:placeholder="props.placeholder"
|
||||
clearable
|
||||
remote-show-suffix
|
||||
filterable
|
||||
remote
|
||||
:remote-method="remoteSearch"
|
||||
:loading="state.loading"
|
||||
@visible-change="(e: boolean) => e && getOptions()"
|
||||
>
|
||||
<el-option v-for="v in state.options" :key="v.id" :label="`${v.name}`" :value="v.id">
|
||||
<div class="flex items-center">
|
||||
<div class="color-primary">{{ v.name }}</div>
|
||||
</div>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="select-hard-group">
|
||||
import { reactive, defineModel, withDefaults, defineProps } from "vue"
|
||||
import * as hardGroup from "/@/api/hard/hard-group"
|
||||
|
||||
const selectId = defineModel()
|
||||
|
||||
export type Props = {
|
||||
placeholder?: string
|
||||
}
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
placeholder: "请选择",
|
||||
})
|
||||
|
||||
const queryForm = reactive<any>({
|
||||
name: 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,
|
||||
}
|
||||
const { data } = await hardGroup.pageJoin(_pa)
|
||||
state.options = data.records ?? []
|
||||
} finally {
|
||||
setTimeout(() => (state.loading = false), 500)
|
||||
}
|
||||
}
|
||||
|
||||
function remoteSearch(params: string) {
|
||||
if (params != queryForm.name) {
|
||||
queryForm.name = params
|
||||
getOptions()
|
||||
}
|
||||
}
|
||||
|
||||
function clear() {
|
||||
state.selectId = null
|
||||
getOptions()
|
||||
}
|
||||
</script>
|
||||
@@ -20,6 +20,7 @@ import SelectMch from "/@/components/Select/SelectMch.vue"
|
||||
import SelectDept from "/@/components/Select/SelectDept.vue"
|
||||
import SelectCtcg from "/@/components/Select/SelectCtcg.vue"
|
||||
import SelectCtcgol from "/@/components/Select/SelectCtcgol.vue"
|
||||
import SelectHardGroup from "/@/components/Select/selectHardGroup.vue"
|
||||
|
||||
// 第三方组件
|
||||
import ElementPlus from "element-plus"
|
||||
@@ -61,6 +62,7 @@ export default {
|
||||
app.component("SelectDept", SelectDept)
|
||||
app.component("SelectCtcg", SelectCtcg)
|
||||
app.component("SelectCtcgol", SelectCtcgol)
|
||||
app.component("SelectHardGroup", SelectHardGroup)
|
||||
|
||||
// 导入全部的elmenet-plus的图标
|
||||
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
|
||||
|
||||
@@ -16,103 +16,112 @@
|
||||
<el-form-item :label="$t('sysdept.name')" prop="name">
|
||||
<el-input v-model="dataForm.name" :placeholder="$t('sysdept.inputnameTip')" clearable />
|
||||
</el-form-item>
|
||||
<el-col v-if="dataForm.parentId == '0'" :span="24" class="mb20">
|
||||
<el-form-item label="硬件分组" prop="hardGroupId">
|
||||
<select-hard-group v-model="dataForm.hardGroupId" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-form-item :label="$t('sysdept.sortOrder')" prop="sortOrder">
|
||||
<el-input-number v-model="dataForm.sortOrder" :placeholder="$t('sysdept.inputsortOrderTip')" clearable />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="visible = false">{{ $t('common.cancelButtonText') }}</el-button>
|
||||
<el-button type="primary" @click="onSubmit" :disabled="loading">{{ $t('common.confirmButtonText') }}</el-button>
|
||||
<el-button @click="visible = false">{{ $t("common.cancelButtonText") }}</el-button>
|
||||
<el-button type="primary" @click="onSubmit" :disabled="loading">{{ $t("common.confirmButtonText") }}</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="systemDeptDialog">
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { getObj, deptTree, addObj, putObj } from '/@/api/admin/dept';
|
||||
import { useMessage } from '/@/hooks/message';
|
||||
import {rule} from "/@/utils/validate";
|
||||
import { useI18n } from "vue-i18n"
|
||||
import { getObj, deptTree, addObj, putObj } from "/@/api/admin/dept"
|
||||
import { useMessage } from "/@/hooks/message"
|
||||
import { rule } from "/@/utils/validate"
|
||||
|
||||
// 定义子组件向父组件传值/事件
|
||||
const emit = defineEmits(['refresh']);
|
||||
const { t } = useI18n();
|
||||
const emit = defineEmits(["refresh"])
|
||||
const { t } = useI18n()
|
||||
// 定义变量内容
|
||||
const deptDialogFormRef = ref();
|
||||
const deptDialogFormRef = ref()
|
||||
const dataForm = reactive({
|
||||
parentId: '',
|
||||
deptId: '',
|
||||
name: '',
|
||||
parentId: "",
|
||||
deptId: "",
|
||||
name: "",
|
||||
sortOrder: 9999,
|
||||
});
|
||||
const parentData = ref<any[]>([]);
|
||||
const visible = ref(false);
|
||||
const loading = ref(false);
|
||||
hardGroupId: "",
|
||||
})
|
||||
const parentData = ref<any[]>([])
|
||||
const visible = ref(false)
|
||||
const loading = ref(false)
|
||||
|
||||
const dataRules = ref({
|
||||
parentId: [{ required: true, message: '上级部门不能为空', trigger: 'blur' }],
|
||||
name: [{ validator: rule.overLength, trigger: 'blur' },{ required: true, message: '部门名称不能为空', trigger: 'blur' }],
|
||||
sortOrder: [{ required: true, message: '排序不能为空', trigger: 'blur' }],
|
||||
});
|
||||
parentId: [{ required: true, message: "上级部门不能为空", trigger: "blur" }],
|
||||
name: [
|
||||
{ validator: rule.overLength, trigger: "blur" },
|
||||
{ required: true, message: "部门名称不能为空", trigger: "blur" },
|
||||
],
|
||||
sortOrder: [{ required: true, message: "排序不能为空", trigger: "blur" }],
|
||||
})
|
||||
|
||||
// 打开弹窗
|
||||
const openDialog = (type: string, id: string) => {
|
||||
visible.value = true;
|
||||
dataForm.deptId = '';
|
||||
visible.value = true
|
||||
dataForm.deptId = ""
|
||||
|
||||
nextTick(() => {
|
||||
deptDialogFormRef.value?.resetFields();
|
||||
dataForm.parentId = id;
|
||||
});
|
||||
deptDialogFormRef.value?.resetFields()
|
||||
dataForm.parentId = id
|
||||
})
|
||||
|
||||
if (type === 'edit') {
|
||||
if (type === "edit") {
|
||||
getObj(id)
|
||||
.then((res) => {
|
||||
Object.assign(dataForm, res.data);
|
||||
Object.assign(dataForm, res.data)
|
||||
})
|
||||
.catch((err) => {
|
||||
useMessage().error(err.msg);
|
||||
});
|
||||
useMessage().error(err.msg)
|
||||
})
|
||||
}
|
||||
|
||||
getDeptData();
|
||||
};
|
||||
getDeptData()
|
||||
}
|
||||
|
||||
// 提交
|
||||
const onSubmit = async () => {
|
||||
const valid = await deptDialogFormRef.value.validate().catch(() => {});
|
||||
if (!valid) return false;
|
||||
const valid = await deptDialogFormRef.value.validate().catch(() => {})
|
||||
if (!valid) return false
|
||||
|
||||
try {
|
||||
loading.value = true;
|
||||
dataForm.deptId ? await putObj(dataForm) : await addObj(dataForm);
|
||||
useMessage().success(t(dataForm.deptId ? 'common.editSuccessText' : 'common.addSuccessText'));
|
||||
visible.value = false;
|
||||
emit('refresh');
|
||||
loading.value = true
|
||||
dataForm.deptId ? await putObj(dataForm) : await addObj(dataForm)
|
||||
useMessage().success(t(dataForm.deptId ? "common.editSuccessText" : "common.addSuccessText"))
|
||||
visible.value = false
|
||||
emit("refresh")
|
||||
} catch (err: any) {
|
||||
useMessage().error(err.msg);
|
||||
useMessage().error(err.msg)
|
||||
} finally {
|
||||
loading.value = false;
|
||||
loading.value = false
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
// 从后端获取菜单信息
|
||||
const getDeptData = async () => {
|
||||
deptTree().then((res) => {
|
||||
parentData.value = [];
|
||||
parentData.value = []
|
||||
const dept = {
|
||||
id: '0',
|
||||
name: '根部门',
|
||||
id: "0",
|
||||
name: "根部门",
|
||||
children: [] as any[],
|
||||
};
|
||||
dept.children = res.data;
|
||||
parentData.value.push(dept);
|
||||
});
|
||||
};
|
||||
}
|
||||
dept.children = res.data
|
||||
parentData.value.push(dept)
|
||||
})
|
||||
}
|
||||
|
||||
// 暴露变量
|
||||
defineExpose({
|
||||
openDialog,
|
||||
});
|
||||
})
|
||||
</script>
|
||||
@@ -113,11 +113,6 @@
|
||||
<el-tag v-for="(item, index) in scope.row.roleList" :key="index">{{ item.roleName }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column width="80" label="人脸">
|
||||
<template #default="{ row }">
|
||||
<preview-image :src="row.faceImgs" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('sysuser.lockFlag')" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
<el-switch
|
||||
@@ -128,6 +123,22 @@
|
||||
></el-switch>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column width="80" label="人脸">
|
||||
<template #default="{ row }">
|
||||
<preview-image :src="row.faceImgs" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="全局人脸" show-overflow-tooltip>
|
||||
<template #default="{ row }">
|
||||
<el-switch
|
||||
v-if="row.isGlobalFace"
|
||||
v-model="row.isGlobalFace"
|
||||
@change="changeGlobalFaceSwitch(row)"
|
||||
active-value="1"
|
||||
inactive-value="0"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('common.action')" width="300" fixed="right">
|
||||
<template #default="scope">
|
||||
<div style="display: flex">
|
||||
@@ -180,11 +191,8 @@
|
||||
</div>
|
||||
</pane>
|
||||
</splitpanes>
|
||||
|
||||
<user-form ref="userDialogRef" @refresh="getDataList(false)" :deptId="state.queryForm.deptId" />
|
||||
|
||||
<face-manage ref="faceManageRef" @refresh="getDataList(false)" />
|
||||
|
||||
<upload-excel
|
||||
ref="excelUploadRef"
|
||||
:title="$t('sysuser.importUserTip')"
|
||||
@@ -197,6 +205,7 @@
|
||||
|
||||
<script lang="ts" name="systemUser" setup>
|
||||
import { delObj, pageList, putObj } from "/@/api/admin/user"
|
||||
import { putGlobalFace } from "/@/api/admin/userFace"
|
||||
import { deptTree } from "/@/api/admin/dept"
|
||||
import { BasicTableProps, useTable } from "/@/hooks/table"
|
||||
import { useMessage, useMessageBox } from "/@/hooks/message"
|
||||
@@ -299,6 +308,14 @@ const changeSwitch = async (row: any) => {
|
||||
getDataList()
|
||||
}
|
||||
|
||||
const changeGlobalFaceSwitch = async (row: any) => {
|
||||
if (!row.isGlobalFace) return
|
||||
// 不修改密码
|
||||
await putGlobalFace({ userId: row.userId, isGlobalFace: row.isGlobalFace })
|
||||
useMessage().success(t("common.optSuccessText"))
|
||||
getDataList()
|
||||
}
|
||||
|
||||
//修改用户密码
|
||||
const changePassword = async (row: any) => {
|
||||
if (!inputPassword.value || inputPassword.value.length < 6 || inputPassword.value.length > 20) {
|
||||
|
||||
@@ -0,0 +1,98 @@
|
||||
<template>
|
||||
<el-dialog :title="form.id ? '编辑' : '新增'" v-model="visible" width="30%" :close-on-click-modal="false" draggable>
|
||||
<el-form ref="dataFormRef" :model="form" :rules="dataRules" formDialogRef label-width="90px" v-loading="loading">
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="24" class="mb20">
|
||||
<el-form-item label="分组名" prop="name">
|
||||
<el-input v-model="form.name" placeholder="请输入分组名" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="visible = false">取消</el-button>
|
||||
<el-button type="primary" @click="onSubmit" :disabled="loading">确认</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="HardGroupDialog">
|
||||
import { useDict } from "/@/hooks/dict"
|
||||
import { useMessage } from "/@/hooks/message"
|
||||
import { getObj, addObj, putObj } from "/@/api/hard/hard-group"
|
||||
import { rule } from "/@/utils/validate"
|
||||
const emit = defineEmits(["refresh"])
|
||||
|
||||
// 定义变量内容
|
||||
const dataFormRef = ref()
|
||||
const visible = ref(false)
|
||||
const loading = ref(false)
|
||||
// 定义字典
|
||||
|
||||
// 提交表单数据
|
||||
const form = reactive({
|
||||
id: "",
|
||||
deptId: "",
|
||||
name: "",
|
||||
})
|
||||
|
||||
// 定义校验规则
|
||||
const dataRules = ref({
|
||||
name: [{ required: true, message: "分组名不能为空", trigger: "blur" }],
|
||||
})
|
||||
|
||||
// 打开弹窗
|
||||
const openDialog = (id: string) => {
|
||||
visible.value = true
|
||||
form.id = ""
|
||||
|
||||
// 重置表单数据
|
||||
nextTick(() => {
|
||||
dataFormRef.value?.resetFields()
|
||||
})
|
||||
|
||||
// 获取hardGroup信息
|
||||
if (id) {
|
||||
form.id = id
|
||||
gethardGroupData(id)
|
||||
}
|
||||
}
|
||||
|
||||
// 提交
|
||||
const onSubmit = async () => {
|
||||
const valid = await dataFormRef.value.validate().catch(() => {})
|
||||
if (!valid) return false
|
||||
|
||||
try {
|
||||
loading.value = true
|
||||
form.id ? await putObj(form) : await addObj(form)
|
||||
useMessage().success(form.id ? "修改成功" : "添加成功")
|
||||
visible.value = false
|
||||
emit("refresh")
|
||||
} catch (err: any) {
|
||||
useMessage().error(err.msg)
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
// 初始化表单数据
|
||||
const gethardGroupData = (id: string) => {
|
||||
// 获取数据
|
||||
loading.value = true
|
||||
getObj(id)
|
||||
.then((res: any) => {
|
||||
Object.assign(form, res.data)
|
||||
})
|
||||
.finally(() => {
|
||||
loading.value = false
|
||||
})
|
||||
}
|
||||
|
||||
// 暴露变量
|
||||
defineExpose({
|
||||
openDialog,
|
||||
})
|
||||
</script>
|
||||
@@ -0,0 +1,154 @@
|
||||
<template>
|
||||
<div class="layout-padding">
|
||||
<div class="layout-padding-auto layout-padding-view">
|
||||
<el-form ref="queryRef" :inline="true" :model="state.queryForm" @keyup.enter="getDataList">
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="4">
|
||||
<el-form-item class="w100" label="分组名" prop="name">
|
||||
<el-input v-model="state.queryForm.name" placeholder="分组名" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-form-item>
|
||||
<el-button icon="Search" type="primary" @click="getDataList">{{ $t("common.queryBtn") }}</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">{{ $t("common.resetBtn") }}</el-button>
|
||||
</el-form-item>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<el-row>
|
||||
<div class="mb8" style="width: 100%">
|
||||
<el-button
|
||||
icon="folder-add"
|
||||
type="primary"
|
||||
class="ml10"
|
||||
@click="formDialogRef.openDialog()"
|
||||
v-auth="'hard_hardGroup_add'"
|
||||
>
|
||||
新 增
|
||||
</el-button>
|
||||
<el-button
|
||||
plain
|
||||
:disabled="multiple"
|
||||
icon="Delete"
|
||||
type="primary"
|
||||
v-auth="'hard_hardGroup_del'"
|
||||
@click="handleDelete(selectObjs)"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
<right-toolbar
|
||||
v-model:showSearch="showSearch"
|
||||
@exportExcel="exportExcel"
|
||||
class="ml10 mr20"
|
||||
style="float: right"
|
||||
@queryTable="getDataList"
|
||||
></right-toolbar>
|
||||
</div>
|
||||
</el-row>
|
||||
<el-table
|
||||
:data="state.dataList"
|
||||
v-loading="state.loading"
|
||||
border
|
||||
:cell-style="tableStyle.cellStyle"
|
||||
:header-cell-style="tableStyle.headerCellStyle"
|
||||
@selection-change="selectionChangHandle"
|
||||
@sort-change="sortChangeHandle"
|
||||
>
|
||||
<el-table-column type="selection" width="40" align="center" />
|
||||
<el-table-column type="index" label="#" width="40" />
|
||||
<el-table-column prop="id" label="编号" />
|
||||
<el-table-column prop="name" label="分组名" />
|
||||
<el-table-column v-if="false" prop="deptName" label="部门" />
|
||||
<el-table-column label="操作" width="150">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
icon="edit-pen"
|
||||
text
|
||||
type="primary"
|
||||
v-auth="'hard_hardGroup_edit'"
|
||||
@click="formDialogRef.openDialog(scope.row.id)"
|
||||
>编辑</el-button
|
||||
>
|
||||
<el-button
|
||||
icon="delete"
|
||||
text
|
||||
type="primary"
|
||||
v-auth="'hard_hardGroup_del'"
|
||||
@click="handleDelete([scope.row.id])"
|
||||
>删除</el-button
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle" v-bind="state.pagination" />
|
||||
</div>
|
||||
|
||||
<!-- 编辑、新增 -->
|
||||
<form-dialog ref="formDialogRef" @refresh="getDataList(false)" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="systemHardGroup">
|
||||
import { BasicTableProps, useTable } from "/@/hooks/table"
|
||||
import { pageJoin, delObjs } from "/@/api/hard/hard-group"
|
||||
import { useMessage, useMessageBox } from "/@/hooks/message"
|
||||
import { useDict } from "/@/hooks/dict"
|
||||
|
||||
// 引入组件
|
||||
const FormDialog = defineAsyncComponent(() => import("./form.vue"))
|
||||
// 定义查询字典
|
||||
|
||||
// 定义变量内容
|
||||
const formDialogRef = ref()
|
||||
// 搜索变量
|
||||
const queryRef = ref()
|
||||
const showSearch = ref(true)
|
||||
// 多选变量
|
||||
const selectObjs = ref([]) as any
|
||||
const multiple = ref(true)
|
||||
|
||||
const state: BasicTableProps = reactive<BasicTableProps>({
|
||||
queryForm: {},
|
||||
pageList: pageJoin,
|
||||
})
|
||||
|
||||
// table hook
|
||||
const { getDataList, currentChangeHandle, sizeChangeHandle, sortChangeHandle, downBlobFile, tableStyle } =
|
||||
useTable(state)
|
||||
|
||||
// 清空搜索条件
|
||||
const resetQuery = () => {
|
||||
// 清空搜索条件
|
||||
queryRef.value?.resetFields()
|
||||
// 清空多选
|
||||
selectObjs.value = []
|
||||
getDataList()
|
||||
}
|
||||
|
||||
// 导出excel
|
||||
const exportExcel = () => {
|
||||
downBlobFile("/hard/hardGroup/export", Object.assign(state.queryForm, { ids: selectObjs }), "hardGroup.xlsx")
|
||||
}
|
||||
|
||||
// 多选事件
|
||||
const selectionChangHandle = (objs: { id: string }[]) => {
|
||||
selectObjs.value = objs.map(({ id }) => id)
|
||||
multiple.value = !objs.length
|
||||
}
|
||||
|
||||
// 删除操作
|
||||
const handleDelete = async (ids: string[]) => {
|
||||
try {
|
||||
await useMessageBox().confirm("此操作将永久删除")
|
||||
} catch {
|
||||
return
|
||||
}
|
||||
|
||||
try {
|
||||
await delObjs(ids)
|
||||
getDataList()
|
||||
useMessage().success("删除成功")
|
||||
} catch (err: any) {
|
||||
useMessage().error(err.msg)
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -14,6 +14,12 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col v-if="false" :span="24" class="mb20">
|
||||
<el-form-item label="分组" prop="hardGroupId">
|
||||
<select-hard-group v-model="form.hardGroupId" placeholder="分组" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="24" class="mb20">
|
||||
<el-form-item label="设备类型" prop="type">
|
||||
<dict-select v-model="form.type" dict-code="hard_type" clearable />
|
||||
@@ -49,6 +55,7 @@ const form = reactive({
|
||||
merchantId: "",
|
||||
deptId: "",
|
||||
name: "",
|
||||
hardGroupId: "",
|
||||
type: "",
|
||||
})
|
||||
|
||||
@@ -56,6 +63,7 @@ const form = reactive({
|
||||
const dataRules = ref({
|
||||
name: [{ required: true, message: "设备名不能为空", trigger: "blur" }],
|
||||
merchantId: [{ required: true, message: "商户不能为空", trigger: "change" }],
|
||||
hardGroupId: [{ required: true, message: "分组不能为空", trigger: "change" }],
|
||||
type: [{ required: true, message: "设备类型不能为空", trigger: "change" }],
|
||||
})
|
||||
|
||||
|
||||
@@ -72,8 +72,9 @@
|
||||
<dict-tag :options="hard_type" :value="row.type" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="hardGroupName" width="200" label="分类" />
|
||||
<el-table-column prop="merchantName" width="100" label="商户" />
|
||||
<el-table-column prop="deptName" width="100" label="部门" />
|
||||
<el-table-column prop="deptName" width="200" label="部门" />
|
||||
<el-table-column prop="uniqueCode" width="200" label="设备唯一编号" />
|
||||
<el-table-column prop="mainTopic" width="350" label="topic" />
|
||||
<el-table-column prop="isTakeFood" width="200" label="是否为当前商户的取餐机器">
|
||||
|
||||
@@ -14,6 +14,12 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<!-- <el-col :span="24" class="mb20">
|
||||
<el-form-item label="硬件分组" prop="hardGroupId">
|
||||
<select-hard-group v-model="form.hardGroupId" />
|
||||
</el-form-item>
|
||||
</el-col> -->
|
||||
|
||||
<el-col :span="24" class="mb20">
|
||||
<el-form-item label="商户类型" prop="merchantType">
|
||||
<el-checkbox-group v-model="form.merchantType">
|
||||
@@ -105,6 +111,7 @@ const form = reactive({
|
||||
jobStartTime: "",
|
||||
jobEndTime: "",
|
||||
rangeDate: [],
|
||||
hardGroupId: "",
|
||||
})
|
||||
|
||||
// 定义校验规则
|
||||
@@ -116,6 +123,7 @@ const dataRules = ref({
|
||||
rangeDate: [{ required: true, message: "请选择营业时间", trigger: "change" }],
|
||||
deptId: [{ required: true, message: "请选择部门", trigger: "change" }],
|
||||
merchantType: [{ required: true, message: "请选择商户类型", trigger: "change" }],
|
||||
hardGroupId: [{ required: true, message: "请选择硬件分组", trigger: "change" }],
|
||||
})
|
||||
|
||||
// 打开弹窗
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
<preview-image :src="row.logoPic" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="collectionCode" width="80" label="商户收款二维码" show-overflow-tooltip>
|
||||
<el-table-column prop="collectionCode" width="150" label="商户收款二维码" show-overflow-tooltip>
|
||||
<template #default="{ row }">
|
||||
<preview-image :src="row.collectionCode" />
|
||||
</template>
|
||||
|
||||
@@ -69,9 +69,9 @@
|
||||
>
|
||||
<el-table-column type="selection" width="40" align="center" />
|
||||
<el-table-column type="index" label="#" width="40" />
|
||||
<el-table-column prop="usernaem" label="用户" show-overflow-tooltip />
|
||||
<el-table-column prop="username" label="用户" show-overflow-tooltip />
|
||||
<el-table-column prop="userMobile" label="手机号" show-overflow-tooltip />
|
||||
<el-table-column prop="deptName" label="部门" show-overflow-tooltip />
|
||||
<el-table-column prop="merchantName" label="商户" show-overflow-tooltip />
|
||||
<el-table-column prop="cardNumber" label="用户卡号" show-overflow-tooltip />
|
||||
<el-table-column prop="isActiveHardware" label="是否激活" show-overflow-tooltip>
|
||||
<template #default="{ row }">
|
||||
|
||||
@@ -78,13 +78,11 @@
|
||||
<el-table-column prop="createTime" label="创建时间" />
|
||||
<el-table-column label="操作" width="200">
|
||||
<template #default="{ row }">
|
||||
<el-button v-if="row.processStatus != 1" icon="Promotion" text type="primary" @click="doInfo(row)">
|
||||
查看审批
|
||||
</el-button>
|
||||
<el-button icon="Promotion" text type="primary" @click="doInfo(row)"> 查看审批 </el-button>
|
||||
<el-button
|
||||
v-if="false"
|
||||
icon="edit-pen"
|
||||
text
|
||||
texts
|
||||
type="primary"
|
||||
v-auth="'wallet_walletFreeze_edit'"
|
||||
@click="formDialogRef.openDialog(row.id)"
|
||||
|
||||
@@ -91,7 +91,7 @@
|
||||
<dict-tag :options="yes_no_type" :value="row.isFreeze" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="activeBindStatus" width="120" label="饭卡绑定状态" />
|
||||
<el-table-column v-if="false" prop="activeBindStatus" width="120" label="饭卡绑定状态" />
|
||||
<el-table-column prop="createTime" width="200" label="创建时间" />
|
||||
<el-table-column label="操作" fixed="right" width="200">
|
||||
<template #default="{ row }">
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
</div>
|
||||
</el-row>
|
||||
<el-table :data="data.list" v-loading="state.loading" border :header-cell-style="tableStyle.headerCellStyle">
|
||||
<el-table-column type="index" label="#" align="center" width="40" />
|
||||
<el-table-column type="index" label="#" align="center" width="60" />
|
||||
<el-table-column prop="username" label="用户" align="center" />
|
||||
<el-table-column prop="userAvatar" label="头像" align="center">
|
||||
<template #default="{ row }">
|
||||
@@ -107,7 +107,11 @@ const currentChangeHandle = (e: any) => {
|
||||
const getList = async () => {
|
||||
state.loading = true
|
||||
try {
|
||||
const { data: pageData } = await walletRechargeApplyApi.comparePageJoin(state.queryForm)
|
||||
const _pa = {
|
||||
...state.pagination,
|
||||
...state.queryForm,
|
||||
}
|
||||
const { data: pageData } = await walletRechargeApplyApi.comparePageJoin(_pa)
|
||||
data.list = pageData.page.records
|
||||
data.total = pageData.page.total
|
||||
data.tableList = pageData.tableList
|
||||
|
||||
Reference in new issue
Block a user