# Conflicts:
#	frontend/src/views/plan/autoTest/components/tree.vue
This commit is contained in:
GYYM
2024-11-14 18:47:15 +08:00
44 changed files with 193 additions and 206 deletions

View File

@@ -3,24 +3,32 @@ import { ADMIN as rePrefix } from "@/api/config/serviceName";
import type { Function } from "@/api/function/interface";
//获取菜单列表
export const getFunctionList = (params: Function.ReqFunctionParams) => {
return http.post(`/function/list`, params);
};
// 获取资源
export const getFunctionList = () => {
return http.get<Function.ResFunction>(`/sysFunction/functionTree`)
}
// 获取资源不包括按钮
export const getFunctionListNoButton = () => {
return http.get<Function.ResFunction>(`/sysFunction/functionTreeNoButton`)
}
//添加菜单列表
export const addFunction = (params: Function.ResFunction) => {
return http.post(`/function/add`,params);
return http.post(`/sysFunction/add`,params);
};
//删除菜单列表
export const deleteFunction = (params: { id: string[] }) => {
return http.post(`/function/delete`, { data: params });
export const deleteFunction = (params: Function.ResFunction) => {
return http.post(`/sysFunction/delete?id=${params.id}`);
};
//编辑菜单列表
export const updateFunction = (params: Function.ResFunction) => {
return http.put(`/function/update`, params);
return http.put(`/sysFunction/update`, params);
};

View File

@@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1731580516863" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1484" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M469.333333 85.333333m42.666667 0l0 0q42.666667 0 42.666667 42.666667l0 128q0 42.666667-42.666667 42.666667l0 0q-42.666667 0-42.666667-42.666667l0-128q0-42.666667 42.666667-42.666667Z" fill="#f38d0d" opacity=".8" p-id="1485"></path><path d="M469.333333 725.333333m42.666667 0l0 0q42.666667 0 42.666667 42.666667l0 128q0 42.666667-42.666667 42.666667l0 0q-42.666667 0-42.666667-42.666667l0-128q0-42.666667 42.666667-42.666667Z" fill="#f38d0d" opacity=".4" p-id="1486"></path><path d="M938.666667 469.333333m0 42.666667l0 0q0 42.666667-42.666667 42.666667l-128 0q-42.666667 0-42.666667-42.666667l0 0q0-42.666667 42.666667-42.666667l128 0q42.666667 0 42.666667 42.666667Z" fill="#f38d0d" opacity=".2" p-id="1487"></path><path d="M298.666667 469.333333m0 42.666667l0 0q0 42.666667-42.666667 42.666667l-128 0q-42.666667 0-42.666667-42.666667l0 0q0-42.666667 42.666667-42.666667l128 0q42.666667 0 42.666667 42.666667Z" fill="#f38d0d" opacity=".6" p-id="1488"></path><path d="M783.530667 180.138667m30.169889 30.169889l0 0q30.169889 30.169889 0 60.339779l-90.509668 90.509668q-30.169889 30.169889-60.339779 0l0 0q-30.169889-30.169889 0-60.339779l90.509668-90.509668q30.169889-30.169889 60.339779 0Z" fill="#f38d0d" opacity=".1" p-id="1489"></path><path d="M330.965333 632.661333m30.16989 30.16989l0 0q30.169889 30.169889 0 60.339778l-90.509668 90.509668q-30.169889 30.169889-60.339779 0l0 0q-30.169889-30.169889 0-60.339778l90.509668-90.509668q30.169889-30.169889 60.339779 0Z" fill="#f38d0d" opacity=".5" p-id="1490"></path><path d="M843.861333 783.530667m-30.169889 30.169889l0 0q-30.169889 30.169889-60.339779 0l-90.509668-90.509668q-30.169889-30.169889 0-60.339779l0 0q30.169889-30.169889 60.339779 0l90.509668 90.509668q30.169889 30.169889 0 60.339779Z" fill="#f38d0d" opacity=".3" p-id="1491"></path><path d="M391.338667 330.965333m-30.16989 30.16989l0 0q-30.169889 30.169889-60.339778 0l-90.509668-90.509668q-30.169889-30.169889 0-60.339779l0 0q30.169889-30.169889 60.339778 0l90.509668 90.509668q30.169889 30.169889 0 60.339779Z" fill="#f38d0d" opacity=".7" p-id="1492"></path></svg>

After

Width:  |  Height:  |  Size: 2.4 KiB

View File

@@ -27,14 +27,13 @@ const dialogVisible = ref<Boolean>(false);
const dialogTitle = ref<string>("");
const openDialog = (title: string) => {
dialogTitle.value = title;
console.log(dialogVisible.value);
dialogVisible.value = true;
};
defineExpose({
openDialog,
});
onMounted(() => {
console.log();
});
</script>
<style lang="scss" scoped></style>

View File

@@ -112,7 +112,7 @@ const findIndex = () => {
}, 0)
if (!find) hiddenIndex.value = -1
} catch (e) {
// console.warn(e);
}
}

View File

@@ -55,7 +55,7 @@
})
// 证明在开始阶段
if (input.selectionStart == 0) {
//console.log('鼠标设置了,', index)
markFlag.value[index].left = true
} else {
markFlag.value[index].left = false
@@ -111,7 +111,7 @@
// 检查ip输入
const checkIpVal = (item: any) => {
let val = item.value;
//console.log(val, '===========')
// 处理非数字
val = val.toString().replace(/[^0-9]/g, "");
val = parseInt(val, 10);
@@ -130,7 +130,7 @@
}
}
item.value = val;
//console.log(item.value, '=========')
}
// 判断光标左右移动位置
@@ -147,7 +147,7 @@
markFlag.value[index].left = false
markFlag.value[index].right = false
} else {
console.log('左键设置了,', index)
markFlag.value[index].left = true
}
} else {
@@ -170,19 +170,19 @@
markFlag.value[index].right = false
}
} else if (e.keyCode === 8) {
//console.log('删除键把当前数据删除完毕后会跳转到前一个input')
// 删除键把当前数据删除完毕后会跳转到前一个input左一不做任何处理
if (index !== 0 && e.currentTarget.selectionStart === 0) {
if (markFlag.value[index].left) {
ipInputRefs.value[index - 1].focus();
markFlag.value[index].left = false
} else {
//console.log('左键设置了删除,', index)
markFlag.value[index].left = true
}
}
} else if (e.keyCode === 13 || e.keyCode === 32) {
//console.log('回车键、空格键、冒号均向右跳转,右一不做任何措施')
// 回车键、空格键、冒号均向右跳转,右一不做任何措施
if (index !== 3) {
ipInputRefs.value[index + 1].focus();
@@ -190,7 +190,7 @@
}
else if (e.keyCode === 110 || e.keyCode === 190) {
// 点 . 向右跳转,右一不做任何措施
// console.log('点击')
if (item.value == '') {
return
}
@@ -199,7 +199,7 @@
}
}
else if (item.value.toString().length === 3) {
//console.log('满3位光标自动向下一个文本框')
// 满3位光标自动向下一个文本框.
if (index !== 3) {
//ipInputRefs.value[index + 1].setSelectionRange(0, 0)
@@ -221,7 +221,7 @@
} else {
if (direction == 'toRight') {
// 可以直接跳回
//console.log('右键focus,', index)
markFlag.value[index].left = true
// 设置光标为左边第一个
ipInputRefs.value[index].setSelectionRange(0, 0)
@@ -252,7 +252,7 @@
// 监听数据变化,并初始化显示四个数据
watch(() => props.value, () => {
//console.log('变化了~', props.value);
if(flag.value){
}else{
@@ -317,7 +317,9 @@
height: 35px;
padding-inline-start: 0px;
padding-left: 10px;
padding-right: 10px;
padding-right: 20px;
padding-top: 0px;
padding-bottom: 0px;;
box-sizing: border-box;
margin: 0;
}

View File

@@ -109,7 +109,7 @@ const timeUnits = ref<TimeUnit[]>(
// 发出日期变化事件
const emitDateChange = () => {
emit('update-dates', formatDate(startDate.value), formatDate(endDate.value))
//console.log('emitDateChange', startDate.value, endDate.value)
}
// 在组件挂载时更新日期范围
@@ -138,7 +138,7 @@ const updateDateRange = () => {
} else if (timeUnit.value === '周') {
startDate.value = getStartOfWeek(today.value)
endDate.value = getEndOfWeek(today.value)
//console.log(endDate.value.toLocaleDateString())
} else if (timeUnit.value === '月') {
// 获取本月的开始和结束日期
startDate.value = new Date(today.value.getFullYear(), today.value.getMonth(), 1);
@@ -167,7 +167,7 @@ const updateDateRange = () => {
// // 确保结束日期不超过今天
// if (endDate.value > today.value) {
// console.log("1111")
// endDate.value = new Date(today.value);
// endDate.value.setHours(23, 59, 59, 999); // 设置结束时间为今天的23:59:59.999
// }
@@ -258,7 +258,7 @@ const nextPeriod = () => {
updateNextButtonStatus()
}
const updateNextButtonStatus = () => {
//console.log(endDate.value)
// 更新下一个按钮的禁用状态
const maxDate = new Date() // 假设最新日期为今天
// 将 maxDate 设置为当天的开始时间

View File

@@ -99,7 +99,7 @@ const init = () => {
}, 0);
};
const resizeCharts = () => {
console.log(77777);
if (chart.value) {
chart.value.resize();
}

View File

@@ -26,7 +26,7 @@ async function handleClick(this: any) {
try {
await navigator.clipboard.writeText(this.copyData);
} catch (err) {
console.error("复制操作不被支持或失败: ", err);
}
ElMessage({
type: "success",

View File

@@ -39,6 +39,6 @@ export const useDownload = async (
document.body.removeChild(exportFile);
window.URL.revokeObjectURL(blobUrl);
} catch (error) {
console.log(error);
}
};

View File

@@ -55,7 +55,7 @@ export const useTable = (
};
},
set: (newVal: any) => {
console.log("我是分页更新之后的值", newVal);
},
});

View File

@@ -93,7 +93,7 @@ export const resetRouter = () => {
* */
router.onError(error => {
NProgress.done()
console.warn('路由错误', error.message)
//console.warn('路由错误', error.message)
})
/**

View File

@@ -1,6 +1,6 @@
<template>
<el-dialog :title="dialogTitle" :model-value="dialogVisible" @close="close" v-bind="dialogMiddle">
<el-form :model="formContent" ref='formRuleRef' :rules='rules' >
<el-form :model="formContent" ref='dialogFormRef' :rules='rules' >
<el-form-item label="上级菜单" prop="pid" :label-width="100">
<el-tree-select
v-model="value"
@@ -29,7 +29,7 @@
<el-input v-model="formContent.component" />
</el-form-item>
<el-form-item label="排序" prop="sort" :label-width="100">
<el-input-number v-model="formContent.sort" />
<el-input-number v-model="formContent.sort" :min='1' :max='999' />
</el-form-item>
<el-form-item label="类型" prop="type" :label-width="100">
<el-select v-model="formContent.type" placeholder="请选择资源类型">
@@ -60,9 +60,10 @@
import { ElMessage, FormInstance, FormItemRule } from 'element-plus'
import { useDictStore } from '@/stores/modules/dict'
import { type Function } from '@/api/function/interface'
import {addFunction,updateFunction,} from '@/api/function/index.ts'
import {addFunction,updateFunction,getFunctionListNoButton} from '@/api/function/index.ts'
import IconSelect from '@/components/SelectIcon/index.vue'
import { functionList } from '@/api/function/functionExample.ts'
import { min } from 'lodash';
const value = ref()
const data = [
@@ -203,30 +204,23 @@ const close = () => {
// 保存数据
const save = () => {
try {
console.log(formContent.value)
dialogFormRef.value?.validate(async (valid: boolean) => {
console.log(valid)
if (valid) {
if (formContent.value.id) {
const result = await updateFunction(formContent.value);
if(result.code != 'A0000'){
ElMessage.error({ message: result.message})
}else{
ElMessage.success({ message: `${dialogTitle.value}成功!` })
}
await updateFunction(formContent.value);
} else {
const result = await addFunction(formContent.value);
if(result.code != 'A0000'){
ElMessage.error({ message: result.message})
}else{
await addFunction(formContent.value);
}
ElMessage.success({ message: `${dialogTitle.value}成功!` })
}
}
close()
// 刷新表格
await props.refreshTable!()
}
})
} catch (err) {
console.error('验证过程中出现错误', err)
//console.error('验证过程中出现错误', err)
}
}

View File

@@ -4,15 +4,12 @@
ref='proTable'
:columns='columns'
:request-api='getFunctionList'
:pagination="false"
>
<!-- :data='userData' -->
<!-- 表格 header 按钮 -->
<template #tableHeader='scope'>
<template #tableHeader>
<el-button type='primary' :icon='CirclePlus' @click="openDialog('add')">新增</el-button>
<el-button type='danger' :icon='Delete' plain :disabled='!scope.isSelected'
@click='batchDelete(scope.selectedListIds)'>
批量删除
</el-button>
</template>
<!-- 表格操作 -->
<template #operation='scope'>
@@ -43,7 +40,7 @@
// 表格配置项
const columns = reactive<ColumnProps<Function.ResFunction>[]>([
{ type: 'selection', fixed: 'left', width: 70 },
{ type: 'index', fixed: 'left', width: 70, label: '序号' },
{
prop: 'name',
label: '名称',
@@ -92,10 +89,12 @@ const openDialog = (titleType: string, row: Partial<Function.ResFunction> = {})
// 删除用户信息
const handleDelete = async (params: Function.ResFunction) => {
await useHandleData(deleteFunction, [params.id] , `删除【${params.name}】用户`)
await useHandleData(deleteFunction, params , `删除【${params.name}】用户`)
proTable.value?.getTableList()
}
// 批量删除用户信息
const batchDelete = async (id: string[]) => {
await useHandleData(deleteFunction, { id }, '删除所选用户信息')

View File

@@ -105,27 +105,18 @@ const close = () => {
dialogFormRef.value?.validate(async (valid: boolean) => {
if (valid) {
if (formContent.value.id) {
const result = await editRole(formContent.value);
if(result.code != 'A0000'){
ElMessage.error({ message: result.message})
}else{
ElMessage.success({ message: `${dialogTitle.value}成功!` })
}
await editRole(formContent.value);
} else {
const result = await addRole(formContent.value);
if(result.code != 'A0000'){
ElMessage.error({ message: result.message})
}else{
await addRole(formContent.value);
}
ElMessage.success({ message: `${dialogTitle.value}成功!` })
}
}
close()
// 刷新表格
await props.refreshTable!()
}
})
} catch (err) {
console.error('验证过程中出现错误', err)
//error('验证过程中出现错误', err)
}
}

View File

@@ -100,14 +100,13 @@ const close = () => {
if (formContent.value.id) {
// 获取勾选的节点 ID
const checkedKeys = treeRef.value?.getCheckedKeys() || [];
console.log('获取勾选的节点 ID',checkedKeys);
// 将 checkedKeys 转换为字符串数组
const checkedKeysAsString: string[] = checkedKeys.map(key => String(key));
// 假设 RoleFunctionId 是一个对象,且需要 id 属性
const roleFunctionIdObject: Role.RoleFunctionId = {
id: checkedKeysAsString
};
console.log('roleFunctionIdObject',roleFunctionIdObject);
const result = await assignFunction(formContent.value,roleFunctionIdObject);
if(result.code != 'A0000'){
ElMessage.error({ message: result.message})
@@ -136,12 +135,10 @@ const open = async (sign: string, data: Role.RoleBO, AllFunction: Function.ResFu
if (result.code === 'A0000') {
// 将 result.data 转换为 Function.ResFunction[] 类型
const roleFunctions = result.data as Function.ResFunction[];
console.log('roleFunctions',roleFunctions)
// 获取 AllFunction 中所有层级的 id
const allIds = getAllIds(AllFunction);
// 匹配 roleFunctions 中的 id 并设置 checkedKeys
const checkedKeys = allIds.filter(id => roleFunctions.some(roleFunc => roleFunc.id === id));
console.log('checkedKeys',checkedKeys)
// 设置 functionList 和 checkedKeys
functionList.value = AllFunction;
checkedKeysRef.value = checkedKeys;

View File

@@ -79,7 +79,6 @@ const rules: Ref<Record<string, Array<FormItemRule>>> = ref({
{ required: true, message: '确认密码必填!', trigger: 'blur' },
{
validator: (rule: FormItemRule, value: string, callback: Function) => {
console.log('1111')
if (value !== formContent.value.newPassword) {
callback(new Error('两次输入的密码不一致!'));
} else {
@@ -107,13 +106,9 @@ const rules: Ref<Record<string, Array<FormItemRule>>> = ref({
dialogFormRef.value?.validate(async (valid: boolean) => {
if (valid) {
if (formContent.value.id) {
const result = await updatePassWord(formContent.value);
if(result.code != 'A0000'){
ElMessage.error({ message: String(result.data)})
}else{
await updatePassWord(formContent.value);
ElMessage.success({ message: `${dialogTitle.value}成功!` })
}
}
close()
// 刷新表格
await props.refreshTable!()

View File

@@ -133,20 +133,11 @@
dialogFormRef.value?.validate(async (valid: boolean) => {
if (valid) {
if (formContent.value.id) {
const result = await updateUser(formContent.value);
if(result.code != 'A0000'){
ElMessage.error({ message: result.message})
}else{
ElMessage.success({ message: `${dialogTitle.value}成功!` })
}
await updateUser(formContent.value);
} else {
const result = await addUser(formContent.value);
if(result.code != 'A0000'){
ElMessage.error({ message: result.message})
}else{
await addUser(formContent.value);
}
ElMessage.success({ message: `${dialogTitle.value}成功!` })
}
}
close()
// 刷新表格
await props.refreshTable!()

View File

@@ -146,7 +146,7 @@ const confirmForm = () => {
if (valid) {
// 将表单数据转为json,发送到后端
let confirmFormData = JSON.parse(JSON.stringify(form.value))
console.log(confirmFormData)
if ('是否新增') {
// 执行新增接口
} else {

View File

@@ -159,7 +159,7 @@ const router = useRouter();
const value1 = ref("");
const value2 = ref("");
const tableHeight = ref(0);
console.log(window.innerHeight, "+++++++++");
//console.log(window.innerHeight, "+++++++++");
tableHeight.value = window.innerHeight - 630;
const deviceData = deviceDataList.plan_devicedata
const operationShow = ref(false);
@@ -361,7 +361,7 @@ const columns = reactive<ColumnProps<Device.ResPqDev>[]>([
label: '归档状态',
minWidth: 100,
},
{ prop: 'operation', label: '操作', fixed: 'right', minWidth: 150 ,isShow: operationShow},
{ prop: 'operation', label: '操作', fixed: 'right', minWidth: 200 ,isShow: operationShow},
])
// 表格配置项
@@ -542,8 +542,8 @@ const sortTable = ({
newIndex?: number;
oldIndex?: number;
}) => {
console.log(newIndex, oldIndex);
console.log(proTable.value?.tableData);
//console.log(newIndex, oldIndex);
//console.log(proTable.value?.tableData);
ElMessage.success("修改列表排序成功");
};
@@ -589,6 +589,7 @@ const changeActiveTabs = (val: number,val2: number) => {
form.value.activeChildTabs= val2;
tableHeaderInit(val)
console.log(form,val,val2,666)
};
//根据当前功能,初始化表头下拉框中的默认值和禁用值
@@ -728,7 +729,7 @@ const openDrawer = (title: string, row: any) => {
}
onMounted(() => {
console.log(proTable.value?.tableData);
//console.log(proTable.value?.tableData);
});
defineExpose({ changeActiveTabs });
</script>

View File

@@ -66,7 +66,7 @@ watch(
},
)
const handleNodeClick = (data) => {
console.log(data)
// console.log(data)
updateSelectedTreeNode()
}
const filterNode = (value: string, data) => {
@@ -78,7 +78,7 @@ const detail = () => {
router.push('/plan')
}
onMounted(() => {
console.log()
// console.log()
})
defineExpose({ getTreeData })
</script>

View File

@@ -38,7 +38,7 @@ import model from "./tabs/model.vue";
import dashboard from "./tabs/dashboard.vue";
import { onMounted } from "vue";
const authStore = useAuthStore();
console.log(authStore.showMenuFlagGet, "????????????????33333333");
const activeIndex = ref("1-1");
const router = useRouter();
const modeList = [
@@ -74,10 +74,10 @@ const handelOpen = async (isActive: any) => {
}
};
const handleSelect = (key: string, keyPath: string[]) => {
console.log(key, keyPath);
//console.log(key, keyPath);
};
onMounted(() => {
console.log();
//console.log();
});
</script>
<style lang="scss" scoped>

View File

@@ -127,7 +127,7 @@ const tabShow= ref(false);
const tabLabel1 = ref('自动检测')
const editableTabsValue = ref('0')
const handleChange = (val: string[]) => {
console.log(val)
// console.log(val)
}
const handleTabsChange = (val) => {
@@ -135,6 +135,7 @@ const handleTabsChange = (val) => {
form.value.activeTabs = 3;
form.value.activeChildTabs = Number(val);
console.log(val)
}
localStorage.setItem("color", "red");
//功能选择数据
@@ -282,7 +283,7 @@ const planDetail = () => {
};
//功能选择css切换
const handleCheckFunction = (val: any) => {
console.log("test",val);
// console.log("test",val);
editableTabsValue.value = '0';
form.value.activeChildTabs = 0;
tabsList.value.map((item: any, index: any) => {
@@ -318,7 +319,7 @@ const handleCheckFunction = (val: any) => {
};
onMounted(() => {
console.log();
// console.log();
getTree();
getPieData();
});

View File

@@ -349,21 +349,13 @@ import { el } from 'element-plus/es/locale'
{
formContent.value.arrivedDate = dayjs(formContent.value.arrivedDate).format('YYYY-MM-DD');
}
//console.log('1111'+formContent.value.arrivedDate)
if (formContent.value.id) {
const result = await updatePqDev(formContent.value);
if(result.code != 'A0000'){
ElMessage.error({ message: result.message})
}else{
await updatePqDev(formContent.value);
ElMessage.success({ message: `${dialogTitle.value}成功!` })
}
} else {
const result = await addPqDev(formContent.value);
if(result.code != 'A0000'){
ElMessage.error({ message: result.message})
}else{
await addPqDev(formContent.value);
ElMessage.success({ message: `${dialogTitle.value}成功!` })
}
}
close()
// 刷新表格

View File

@@ -64,7 +64,7 @@ const columns = reactive<ColumnProps<Device.ResPqDev>[]>([
{
prop: 'name',
label: '名称',
search: { el: 'input',order:2,offset:0.1},
search: { el: 'input'},
minWidth: 200,
},
{
@@ -74,36 +74,12 @@ const columns = reactive<ColumnProps<Device.ResPqDev>[]>([
fieldNames: { label: 'name', value: 'code' },
minWidth: 200,
},
{
prop: 'devChns',
label: '设备通道数',
minWidth: 110,
},
{
prop: 'devVolt',
label: '额定电压V',
minWidth: 130,
},
{
prop: 'devCurr',
label: '额定电流A',
minWidth: 130,
},
{
prop: 'manufacturer',
label: '生产厂商',
enum: dictStore.getDictData('Dev_Manufacturers'),
search: { el: 'select', props: { filterable: true }},
fieldNames: { label: 'name', value: 'code' },
minWidth: 200,
},
{
prop: 'createDate',
label: '生产日期',
minWidth: 200,
search: {
order:1,
span:2,
render: () => {
return (
<div class='flx-flex-start'>
@@ -117,6 +93,38 @@ const columns = reactive<ColumnProps<Device.ResPqDev>[]>([
},
},
},
{
prop: 'devChns',
label: '设备通道数',
minWidth: 110,
render: scope => {
return String(scope.row.devChns) // 将数字转换为字符串
},
},
{
prop: 'devVolt',
label: '额定电压V',
minWidth: 130,
render: scope => {
return String(scope.row.devVolt) // 将数字转换为字符串
},
},
{
prop: 'devCurr',
label: '额定电流A',
minWidth: 130,
render: scope => {
return String(scope.row.devCurr) // 将数字转换为字符串
},
},
{
prop: 'manufacturer',
label: '生产厂商',
enum: dictStore.getDictData('Dev_Manufacturers'),
search: { el: 'select', props: { filterable: true },order:1},
fieldNames: { label: 'name', value: 'code' },
minWidth: 200,
},
{ prop: 'operation', label: '操作', fixed: 'right', width: 200 },
])
@@ -127,13 +135,10 @@ const endDate = ref('')
const handleDateChange = (startDateTemp: string, endDateTemp: string) => {
startDate.value = startDateTemp
endDate.value = endDateTemp
//console.log(startDateTemp)
//console.log(endDateTemp)
}
// 打开 drawer(新增、编辑)
const openDialog = (titleType: string, row: Partial<Device.ResPqDev> = {}) => {
devicePopup.value?.open(titleType, row)
console.log(columns)
}
// 批量删除设备
@@ -150,9 +155,16 @@ const handleDelete = async (params: Device.ResPqDev) => {
}
// 导出设备
const downloadFile = async () => {
const downloadFile = async (params: Device.ReqPqDevParams) => {
// 获取当前的搜索参数
const searchParam = proTable.value?.searchParam || {};
// 将开始时间和结束时间添加到搜索参数中
searchParam.searchBeginTime = startDate.value;
searchParam.searchEndTime = endDate.value;
ElMessageBox.confirm('确认导出被检设备?', '温馨提示', { type: 'warning' }).then(() =>
useDownload(exportPqDev, '被检设备导出数据', proTable.value?.searchParam, false,'.xlsx'),
useDownload(exportPqDev,'被检设备导出数据', proTable.value?.searchParam, false,'.xlsx'),
)
}

View File

@@ -288,7 +288,7 @@ const typeList = [
{
// 将表单数据转为json,发送到后端
let confirmFormData = JSON.parse(JSON.stringify(props.formData));
console.log(confirmFormData)
// console.log(confirmFormData)
emit('submit', props.formData); // 提交表单数据
emit('update:visible', false); // 提交后关闭对话框
}

View File

@@ -108,7 +108,7 @@ const columns = ref<ColumnProps<ErrorSystem.ErrorSystemList>[]>([
search: { el: 'select', props: { filterable: true } },
fieldNames: { label: 'label', value: 'code' },
},
{ prop: 'operation', label: '操作', fixed: 'right' ,width: 300,},
{ prop: 'operation', label: '操作', fixed: 'right' ,width: 250,},
])
// 打开编辑对话框

View File

@@ -18,7 +18,6 @@
</template>
<!-- 表格操作 -->
<template #operation='scope'>
<el-button type='primary' link :icon='View' >查看</el-button>
<el-button type='primary' link :icon='EditPen' >编辑</el-button>
<el-button type='primary' link :icon='Delete' >删除</el-button>
<el-button type='primary' :model-value="false" link :icon='Upload' >升级为模板</el-button>
@@ -114,7 +113,7 @@ const columns = reactive<ColumnProps<TestScript.TestScriptBO>[]>([
search: { el: 'select' },
minWidth: 150,
},
{ prop: 'operation', label: '操作', fixed: 'right', width: 330 },
{ prop: 'operation', label: '操作', fixed: 'right', width: 250 },
])

View File

@@ -103,7 +103,7 @@
search: { el: 'select' },
minWidth: 150,
},
{ prop: 'operation', label: '操作', fixed: 'right', width: 330 },
{ prop: 'operation', label: '操作', fixed: 'right', width: 250 },
])

View File

@@ -24,10 +24,9 @@
class="custom-tree-node"
style="display: flex; align-items: center"
>
<CircleCheck v-if="data.isChildNode && data.scriptIdx < currentIndex" style="width:18px;height: 18px;margin-right:8px;color:#67C23A;"/>
<svg-icon name="wind" spin></svg-icon>
<Loading v-if="data.isChildNode && data.scriptIdx === currentIndex" style="width:18px;height: 18px;margin-right:8px;color:#E6A23C;"/>
<svg-icon v-if="data.isChildNode && data.scriptIdx === currentIndex" name="loading" spin ></svg-icon>
<span>{{ node.label }}</span>
</span>
</template>
@@ -73,7 +72,7 @@ const timer = setInterval(() => {
currentIndex.value++;
if (currentIndex.value > 14)
currentIndex.value = 0;
console.log(currentIndex.value);
// console.log(currentIndex.value);
}, 2000);
@@ -88,7 +87,7 @@ watch(
}
);
const changeSelect=()=>{
console.log(treeRef.value.getCheckedKeys());
//console.log(treeRef.value.getCheckedKeys());
}
const handleNodeClick = (data) => {
console.log(data);

View File

@@ -13,6 +13,7 @@
:label="item.name"
></el-checkbox
>
<el-button type="primary" @click="handlePreTest">预检测</el-button>
<el-button type="primary" @click="handleAutoTest">正式检测</el-button>
<el-button type="primary" @click="handleBackDeviceList"

View File

@@ -100,7 +100,7 @@
label: '归档状态',
minWidth: 110,
},
{ prop: 'operation', label: '操作', fixed: 'right', minWidth: 150 },
{ prop: 'operation', label: '操作', fixed: 'right', minWidth: 100 },
])
const open = (textTitle: string) => {

View File

@@ -142,7 +142,7 @@ const rules: Ref<Record<string, Array<FormItemRule>>> = ref({
{
// 将表单数据转为json,发送到后端
let confirmFormData = JSON.parse(JSON.stringify(props.formData));
console.log(confirmFormData)
//console.log(confirmFormData)
emit('submit', props.formData); // 提交表单数据
emit('update:visible', false); // 提交后关闭对话框
}

View File

@@ -77,7 +77,7 @@
search: { el: 'select' },
minWidth: 150,
},
{ prop: 'operation', label: '操作', fixed: 'right', width: 150 },
{ prop: 'operation', label: '操作', fixed: 'right', width: 100 },
])
const open = (textTitle: string) => {

View File

@@ -317,7 +317,7 @@ function handleFiles(event: Event) {
const files = target.files
if (files && files.length > 0) {
// 处理文件
console.log(files)
// console.log(files)
ElMessageBox.confirm(
'导入的数据与当前数据有冲突,请选择以哪个数据为主进行覆盖',
'数据冲突',
@@ -366,7 +366,7 @@ const combineClick = () => {
},
)
.then(({ value }) => {
console.log(`合并后的计划名为:`, value)
// console.log(`合并后的计划名为:`, value)
proTable.value?.clearSelection()
proTable.value?.getTableList()
})

View File

@@ -95,7 +95,7 @@ onBeforeUnmount(() => {
handleEnter();
});
const dataSource = computed(() => {
console.log("dataSource", dataSource);
//console.log("dataSource", dataSource);
return props.dataSource;
});
watch(

View File

@@ -53,7 +53,7 @@ const activities = [
const data = ref([]);
const open = (list: any) => {
data.value = list;
console.log(data.value, "99999999");
// console.log(data.value, "99999999");
};
onMounted(() => {

View File

@@ -408,8 +408,8 @@ const sortTable = ({
newIndex?: number;
oldIndex?: number;
}) => {
console.log(newIndex, oldIndex);
console.log(proTable.value?.tableData);
// console.log(newIndex, oldIndex);
//console.log(proTable.value?.tableData);
ElMessage.success("修改列表排序成功");
};

View File

@@ -23,7 +23,7 @@
</el-select>
</el-form-item>
<el-form-item label="排序" :label-width="100">
<el-input-number v-model="formContent.sort"/>
<el-input-number v-model="formContent.sort" :min='1' :max='999'/>
</el-form-item>
</el-form>
</div>
@@ -41,14 +41,12 @@
import {dialogSmall} from "@/utils/elementBind";
import {addDictData, updateDictData} from "@/api/system/dictionary/dictData";
import {Dict} from "@/api/system/dictionary/interface";
import {FormItemRule} from "element-plus";
import {ElMessage, FormItemRule} from "element-plus";
import type {Ref} from "vue";
const rules: Ref<Record<string, Array<FormItemRule>>> = ref({
name: [{required: true, message: '类型名称必填!', trigger: 'blur'}],
code: [{required: true, message: '类型编码必填!', trigger: 'blur'}],
dictValue: [{required: true, message: '类型值必填!', trigger: 'blur'}],
level: [{required: true, message: '事件等级必填!', trigger: 'blur'}],
})
const dialogFormRef = ref()
@@ -115,7 +113,6 @@ const save = () => {
dialogFormRef.value?.validate(async (valid: boolean) => {
if (valid) {
formContent.value.value = formContent.value.dictValue
console.log(formContent.value)
if (formContent.value.id) {
await updateDictData(formContent.value)
} else {

View File

@@ -98,7 +98,7 @@
</el-select>
</el-form-item>
<el-form-item label='排序' :label-width='140'>
<el-input-number v-model='formContent.sort' :min="0" controls-position="right" style="width: 300px;"/>
<el-input-number v-model='formContent.sort' :min='1' :max='999' />
</el-form-item>
<el-divider >拓展数据</el-divider>
<el-form-item label='参数缺省值' :label-width='140' prop='defaultValue'>
@@ -229,12 +229,10 @@
formContent.value.statMethod = selectedStatMethods.value.join(',')
if (formContent.value.id) {
await updateDictPq(formContent.value);
ElMessage.success({ message: `${dialogTitle.value}成功!` })
} else {
const result = await addDictPq(formContent.value);
ElMessage.success({ message: `${dialogTitle.value}成功!` })
await addDictPq(formContent.value);
}
ElMessage.success({ message: `${dialogTitle.value}成功!` })
close()
// 刷新表格
await props.refreshTable!()

View File

@@ -117,17 +117,16 @@ const columns = reactive<ColumnProps<Dict.ResDictPq>[]>([
const codeString = Array.isArray(codes) ? codes.join(',') : codes
const codeArray = codeString.split(',')
if (codeArray.length > 1) {
console.log('多个 code', codeString)
// 查找与每个 code 值匹配的 name然后拼接成逗号分割的字符串
const names = codeArray.map(code => {
const dictItem = dictStore.getDictData('Stat_Method').find(item => item.code === code)
return dictItem ? dictItem.name : '' // 如果找到匹配的项,返回对应的 name
return dictItem ? dictItem.code : '/' // 如果找到匹配的项,返回对应的 code
})
return names.join(', ') // 用逗号连接所有的 name
}
// 查找单个 code 对应的 name
const dictItem = dictStore.getDictData('Stat_Method').find(item => item.code === codeArray[0])
return dictItem ? dictItem.name : '' // 如果找到匹配的项,返回对应的 name
return dictItem ? dictItem.code : '/' // 如果找到匹配的项,返回对应的 code
},
},
{
@@ -145,6 +144,14 @@ const columns = reactive<ColumnProps<Dict.ResDictPq>[]>([
enum: dictStore.getDictData('Data_Day'),
fieldNames: { label: 'name', value: 'code' }
},
{
prop: 'sort',
label: '排序',
width:70,
render: scope => {
return String(scope.row.sort) // 将数字转换为字符串
},
},
{
prop: 'operation',
label: '操作',

View File

@@ -4,8 +4,8 @@
<el-form-item label='字典名称' :label-width='100' prop='name'>
<el-input v-model='formContent.name' placeholder='请输入字典名称' autocomplete='off' />
</el-form-item>
<el-form-item label='序' :label-width='100'>
<el-input-number v-model='formContent.sort' :min="0" controls-position="right" style="width: 300px;"/>
<el-form-item label='序' :label-width='100'>
<el-input-number v-model='formContent.sort' :min='1' :max='999' />
</el-form-item>
<el-form-item label='编码' :label-width='100' prop='code'>
<el-input v-model='formContent.code' placeholder='请输入字典编码' autocomplete='off' />
@@ -95,23 +95,15 @@
if (formContent.value.id) {
let result: ResultData<unknown>;
if( titleType.value == 'add'){
result = await addDictTree(formContent.value);
await addDictTree(formContent.value);
}else{
result = await updateDictTree(formContent.value);
await updateDictTree(formContent.value);
}
if(result.code != 'A0000'){
ElMessage.error({ message: result.message})
}else{
ElMessage.success({ message: `${dialogTitle.value}成功!` })
}
} else {
const result = await addDictTree(formContent.value);
if(result.code != 'A0000'){
ElMessage.error({ message: result.message})
}else{
await addDictTree(formContent.value);
ElMessage.success({ message: `${dialogTitle.value}成功!` })
}
}
close()
// 刷新表格

View File

@@ -39,25 +39,32 @@
const treePopup = ref()
const columns = reactive<ColumnProps<Dict.ResDictTree>[]>([
{ type: 'index', fixed: 'left', width: 70, label: '序号' },
{
prop: 'name',
label: '字典名称',
},
{
prop: 'code',
label: '编码',
},
{
prop: 'remark',
label: '描述',
},
{
prop: 'sort',
label: '排序',
width:70,
render: scope => {
return String(scope.row.sort) // 将数字转换为字符串
},
},
{
prop: 'state',
label: '状态',
minWidth:30,
isShow:false,
enum: dictStore.getDictData('state'),
fieldNames: { label: 'label', value: 'code' },
render: scope => {
@@ -65,6 +72,7 @@
<el-tag type={scope.row.state === 0 ? 'success' : (scope.row.state === 1 ? 'warning' : 'danger')}>
{scope.row.state === 0 ? '正常' : (scope.row.state === 1 ? '停用' : '删除')}
</el-tag>
)
},
},
@@ -72,7 +80,8 @@
prop: 'operation',
label: '操作',
fixed: 'right',
width: 250,
width:250,
},
])
@@ -84,7 +93,6 @@
// 删除字典类型
const handleDelete = async (params: Dict.ResDictTree) => {
console.log(params)
await useHandleData(deleteDictTree, params, `删除【${params.name}】树形字典类型`)
proTable.value?.getTableList()
}

View File

@@ -21,7 +21,7 @@
</el-radio-group>
</el-form-item>
<el-form-item label='排序' :label-width='100'>
<el-input-number v-model='formContent.sort' />
<el-input-number v-model='formContent.sort' :min='1' :max='999'/>
</el-form-item>
<el-form-item label='备注' :label-width='100'>
<el-input v-model='formContent.remark' placeholder='请输入备注' autocomplete='off' :rows='2'

View File

@@ -69,6 +69,9 @@ const columns = reactive<ColumnProps<Dict.ResDictType>[]>([
prop: 'sort',
label: '排序',
minWidth: 70,
render: scope => {
return String(scope.row.sort) // 将数字转换为字符串
},
},
{
prop: 'createTime',
@@ -79,7 +82,7 @@ const columns = reactive<ColumnProps<Dict.ResDictType>[]>([
prop: 'operation',
label: '操作',
fixed: 'right',
minWidth: 250,
width: 250,
},
])