Browse Source

新增任务列表页面

新增任务表单页面
master
parent
commit
8c7027672b
  1. 149
      src/BusinessCom/ChoosePersonnel/index.vue
  2. 469
      src/views/system/dict/index.vue
  3. 118
      src/views/task/form.vue
  4. 206
      src/views/task/index.vue
  5. 19
      src/views/tool/componentview/index.vue
  6. 5
      vite.config.js

149
src/BusinessCom/ChoosePersonnel/index.vue

@ -0,0 +1,149 @@
<template>
<section>
<el-button type="primary" @click="selectPersonnal">选择人员</el-button>
<teleport to="body">
<section
class="choose-container"
v-if="showChoose"
@click.self="showChoose = false"
>
<section class="choose-wrapper">
<section class="isChoose">
<section class="none">待选区</section>
</section>
<section class="chooseOption">
<el-form inline :model="form">
<el-form-item label="用户昵称">
<el-input
v-model="form.username"
placeholder="请输入用户名称"
/>
</el-form-item>
<el-form-item label="角色">
<el-select
v-model="form.role"
style="width: 200px"
placeholder="请选择角色"
>
<el-option> </el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary">查询</el-button>
<el-button>重置</el-button>
</el-form-item>
</el-form>
</section>
<section>
<el-table v-loading="loading" :data="tableData">
<el-table-column
label="用户编号"
align="center"
key="userId"
prop="userId"
/>
<el-table-column
label="用户名称"
align="center"
key="userName"
prop="userName"
:show-overflow-tooltip="true"
/>
<el-table-column
label="用户昵称"
align="center"
key="nickName"
prop="nickName"
:show-overflow-tooltip="true"
/>
<el-table-column
label="部门"
align="center"
key="deptName"
prop="dept.deptName"
:show-overflow-tooltip="true"
/>
<el-table-column
label="手机号码"
align="center"
key="phonenumber"
prop="phonenumber"
width="120"
/>
</el-table>
<pagination
v-show="total > 0"
:total="total"
v-model:page="form.pageNum"
v-model:limit="form.pageSize"
/>
</section>
</section>
</section>
</teleport>
</section>
</template>
<script setup>
const loading = ref(false);
const tableData = ref([]);
const showChoose = ref(false);
const total = ref(0);
const form = ref({
username: undefined,
role: undefined,
pageSize: 10,
pageNum: 1,
});
function selectPersonnal() {
showChoose.value = true;
}
</script>
<style scoped lang="scss">
.choose-container {
cursor: pointer;
position: absolute;
inset: 0;
background-color: var(--el-overlay-color-lighter);
z-index: 9999;
display: flex;
justify-content: center;
align-items: center;
.choose-wrapper {
min-width: 60vw;
min-height: 60vh;
background-color: #fff;
border-radius: var(--el-border-radius-base, 4px);
display: grid;
padding: 15px;
grid-template-rows: auto 1fr;
grid-template-columns: 25% 1fr;
grid-gap: 15px;
grid-template-areas:
"ischoose chooseoption"
"ischoose waitchoose";
.isChoose {
grid-area: ischoose;
border: 1px dashed #ccc;
border-radius: var(--el-border-radius-base, 4px);
.none{
height: 100%;
width: 100%;
display: flex;
justify-content: center;
align-items: center;
color: var(--el-text-color-secondary);
font-size: 14px;
}
}
.chooseOption {
grid-area: chooseoption;
}
}
}
</style>

469
src/views/system/dict/index.vue

@ -1,179 +1,252 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px"> <el-form
<el-form-item label="字典名称" prop="dictName"> :model="queryParams"
<el-input ref="queryRef"
v-model="queryParams.dictName" :inline="true"
placeholder="请输入字典名称" v-show="showSearch"
clearable label-width="68px"
style="width: 240px" >
@keyup.enter="handleQuery" <el-form-item label="字典名称" prop="dictName">
/> <el-input
</el-form-item> v-model="queryParams.dictName"
<el-form-item label="字典类型" prop="dictType"> placeholder="请输入字典名称"
<el-input clearable
v-model="queryParams.dictType" style="width: 240px"
placeholder="请输入字典类型" @keyup.enter="handleQuery"
clearable />
style="width: 240px" </el-form-item>
@keyup.enter="handleQuery" <el-form-item label="字典类型" prop="dictType">
/> <el-input
</el-form-item> v-model="queryParams.dictType"
<el-form-item label="状态" prop="status"> placeholder="请输入字典类型"
<el-select clearable
v-model="queryParams.status" style="width: 240px"
placeholder="字典状态" @keyup.enter="handleQuery"
clearable />
style="width: 240px" </el-form-item>
> <el-form-item label="状态" prop="status">
<el-option <el-select
v-for="dict in sys_normal_disable" v-model="queryParams.status"
:key="dict.value" placeholder="字典状态"
:label="dict.label" clearable
:value="dict.value" style="width: 240px"
/> >
</el-select> <el-option
</el-form-item> v-for="dict in sys_normal_disable"
<el-form-item label="创建时间" style="width: 308px"> :key="dict.value"
<el-date-picker :label="dict.label"
v-model="dateRange" :value="dict.value"
value-format="YYYY-MM-DD" />
type="daterange" </el-select>
range-separator="-" </el-form-item>
start-placeholder="开始日期" <el-form-item label="创建时间" style="width: 308px">
end-placeholder="结束日期" <el-date-picker
></el-date-picker> v-model="dateRange"
</el-form-item> value-format="YYYY-MM-DD"
<el-form-item> type="daterange"
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button> range-separator="-"
<el-button icon="Refresh" @click="resetQuery">重置</el-button> start-placeholder="开始日期"
</el-form-item> end-placeholder="结束日期"
</el-form> ></el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="Search" @click="handleQuery"
>搜索</el-button
>
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb8">
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
type="primary" type="primary"
plain plain
icon="Plus" icon="Plus"
@click="handleAdd" @click="handleAdd"
v-hasPermi="['system:dict:add']" v-hasPermi="['system:dict:add']"
>新增</el-button> >新增</el-button
</el-col> >
<el-col :span="1.5"> </el-col>
<el-button <el-col :span="1.5">
type="success" <el-button
plain type="success"
icon="Edit" plain
:disabled="single" icon="Edit"
@click="handleUpdate" :disabled="single"
v-hasPermi="['system:dict:edit']" @click="handleUpdate"
>修改</el-button> v-hasPermi="['system:dict:edit']"
</el-col> >修改</el-button
<el-col :span="1.5"> >
<el-button </el-col>
type="danger" <el-col :span="1.5">
plain <el-button
icon="Delete" type="danger"
:disabled="multiple" plain
@click="handleDelete" icon="Delete"
v-hasPermi="['system:dict:remove']" :disabled="multiple"
>删除</el-button> @click="handleDelete"
</el-col> v-hasPermi="['system:dict:remove']"
<el-col :span="1.5"> >删除</el-button
<el-button >
type="warning" </el-col>
plain <el-col :span="1.5">
icon="Download" <el-button
@click="handleExport" type="warning"
v-hasPermi="['system:dict:export']" plain
>导出</el-button> icon="Download"
</el-col> @click="handleExport"
<el-col :span="1.5"> v-hasPermi="['system:dict:export']"
<el-button >导出</el-button
type="danger" >
plain </el-col>
icon="Refresh" <el-col :span="1.5">
@click="handleRefreshCache" <el-button
v-hasPermi="['system:dict:remove']" type="danger"
>刷新缓存</el-button> plain
</el-col> icon="Refresh"
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar> @click="handleRefreshCache"
</el-row> v-hasPermi="['system:dict:remove']"
>刷新缓存</el-button
>
</el-col>
<right-toolbar
v-model:showSearch="showSearch"
@queryTable="getList"
></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="typeList" @selection-change="handleSelectionChange"> <el-table
<el-table-column type="selection" width="55" align="center" /> v-loading="loading"
<el-table-column label="字典编号" align="center" prop="dictId" /> :data="typeList"
<el-table-column label="字典名称" align="center" prop="dictName" :show-overflow-tooltip="true"/> @selection-change="handleSelectionChange"
<el-table-column label="字典类型" align="center" :show-overflow-tooltip="true"> >
<template #default="scope"> <el-table-column type="selection" width="55" align="center" />
<router-link :to="'/system/dict-data/index/' + scope.row.dictId" class="link-type"> <el-table-column label="字典编号" align="center" prop="dictId" />
<span>{{ scope.row.dictType }}</span> <el-table-column
</router-link> label="字典名称"
</template> align="center"
</el-table-column> prop="dictName"
<el-table-column label="状态" align="center" prop="status"> :show-overflow-tooltip="true"
<template #default="scope"> />
<dict-tag :options="sys_normal_disable" :value="scope.row.status" /> <el-table-column
</template> label="字典类型"
</el-table-column> align="center"
<el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip="true" /> :show-overflow-tooltip="true"
<el-table-column label="创建时间" align="center" prop="createTime" width="180"> >
<template #default="scope"> <template #default="scope">
<span>{{ parseTime(scope.row.createTime) }}</span> <router-link
</template> :to="'/system/dict-data/index/' + scope.row.dictId"
</el-table-column> class="link-type"
<el-table-column label="操作" align="center" width="160" class-name="small-padding fixed-width"> >
<template #default="scope"> <span>{{ scope.row.dictType }}</span>
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['system:dict:edit']">修改</el-button> </router-link>
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['system:dict:remove']">删除</el-button> </template>
</template> </el-table-column>
</el-table-column> <el-table-column label="状态" align="center" prop="status">
</el-table> <template #default="scope">
<dict-tag :options="sys_normal_disable" :value="scope.row.status" />
<pagination </template>
v-show="total > 0" </el-table-column>
:total="total" <el-table-column
v-model:page="queryParams.pageNum" label="备注"
v-model:limit="queryParams.pageSize" align="center"
@pagination="getList" prop="remark"
:show-overflow-tooltip="true"
/> />
<el-table-column
label="创建时间"
align="center"
prop="createTime"
width="180"
>
<template #default="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
</el-table-column>
<el-table-column
label="操作"
align="center"
width="160"
class-name="small-padding fixed-width"
>
<template #default="scope">
<el-button
link
type="primary"
icon="Edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['system:dict:edit']"
>修改</el-button
>
<el-button
link
type="primary"
icon="Delete"
@click="handleDelete(scope.row)"
v-hasPermi="['system:dict:remove']"
>删除</el-button
>
</template>
</el-table-column>
</el-table>
<!-- 添加或修改参数配置对话框 --> <pagination
<el-dialog :title="title" v-model="open" width="500px" append-to-body> v-show="total > 0"
<el-form ref="dictRef" :model="form" :rules="rules" label-width="80px"> :total="total"
<el-form-item label="字典名称" prop="dictName"> v-model:page="queryParams.pageNum"
<el-input v-model="form.dictName" placeholder="请输入字典名称" /> v-model:limit="queryParams.pageSize"
</el-form-item> @pagination="getList"
<el-form-item label="字典类型" prop="dictType"> />
<el-input v-model="form.dictType" placeholder="请输入字典类型" />
</el-form-item> <!-- 添加或修改参数配置对话框 -->
<el-form-item label="状态" prop="status"> <el-dialog :title="title" v-model="open" width="500px" append-to-body>
<el-radio-group v-model="form.status"> <el-form ref="dictRef" :model="form" :rules="rules" label-width="80px">
<el-radio <el-form-item label="字典名称" prop="dictName">
v-for="dict in sys_normal_disable" <el-input v-model="form.dictName" placeholder="请输入字典名称" />
:key="dict.value" </el-form-item>
:value="dict.value" <el-form-item label="字典类型" prop="dictType">
>{{ dict.label }}</el-radio> <el-input v-model="form.dictType" placeholder="请输入字典类型" />
</el-radio-group> </el-form-item>
</el-form-item> <el-form-item label="状态" prop="status">
<el-form-item label="备注" prop="remark"> <el-radio-group v-model="form.status">
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容"></el-input> <el-radio
</el-form-item> v-for="dict in sys_normal_disable"
</el-form> :key="dict.value"
<template #footer> :value="dict.value"
<div class="dialog-footer"> >{{ dict.label }}</el-radio
<el-button type="primary" @click="submitForm"> </el-button> >
<el-button @click="cancel"> </el-button> </el-radio-group>
</div> </el-form-item>
</template> <el-form-item label="备注" prop="remark">
</el-dialog> <el-input
</div> v-model="form.remark"
type="textarea"
placeholder="请输入内容"
></el-input>
</el-form-item>
</el-form>
<template #footer>
<div class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</template>
</el-dialog>
</div>
</template> </template>
<script setup name="Dict"> <script setup name="Dict">
import useDictStore from '@/store/modules/dict' import useDictStore from "@/store/modules/dict";
import { listType, getType, delType, addType, updateType, refreshCache } from "@/api/system/dict/type"; import {
listType,
getType,
delType,
addType,
updateType,
refreshCache,
} from "@/api/system/dict/type";
const { proxy } = getCurrentInstance(); const { proxy } = getCurrentInstance();
const { sys_normal_disable } = proxy.useDict("sys_normal_disable"); const { sys_normal_disable } = proxy.useDict("sys_normal_disable");
@ -196,11 +269,15 @@ const data = reactive({
pageSize: 10, pageSize: 10,
dictName: undefined, dictName: undefined,
dictType: undefined, dictType: undefined,
status: undefined status: undefined,
}, },
rules: { rules: {
dictName: [{ required: true, message: "字典名称不能为空", trigger: "blur" }], dictName: [
dictType: [{ required: true, message: "字典类型不能为空", trigger: "blur" }] { required: true, message: "字典名称不能为空", trigger: "blur" },
],
dictType: [
{ required: true, message: "字典类型不能为空", trigger: "blur" },
],
}, },
}); });
@ -209,11 +286,13 @@ const { queryParams, form, rules } = toRefs(data);
/** 查询字典类型列表 */ /** 查询字典类型列表 */
function getList() { function getList() {
loading.value = true; loading.value = true;
listType(proxy.addDateRange(queryParams.value, dateRange.value)).then(response => { listType(proxy.addDateRange(queryParams.value, dateRange.value)).then(
typeList.value = response.rows; (response) => {
total.value = response.total; typeList.value = response.rows;
loading.value = false; total.value = response.total;
}); loading.value = false;
},
);
} }
/** 取消按钮 */ /** 取消按钮 */
@ -229,7 +308,7 @@ function reset() {
dictName: undefined, dictName: undefined,
dictType: undefined, dictType: undefined,
status: "0", status: "0",
remark: undefined remark: undefined,
}; };
proxy.resetForm("dictRef"); proxy.resetForm("dictRef");
} }
@ -256,7 +335,7 @@ function handleAdd() {
/** 多选框选中数据 */ /** 多选框选中数据 */
function handleSelectionChange(selection) { function handleSelectionChange(selection) {
ids.value = selection.map(item => item.dictId); ids.value = selection.map((item) => item.dictId);
single.value = selection.length != 1; single.value = selection.length != 1;
multiple.value = !selection.length; multiple.value = !selection.length;
} }
@ -265,7 +344,7 @@ function handleSelectionChange(selection) {
function handleUpdate(row) { function handleUpdate(row) {
reset(); reset();
const dictId = row.dictId || ids.value; const dictId = row.dictId || ids.value;
getType(dictId).then(response => { getType(dictId).then((response) => {
form.value = response.data; form.value = response.data;
open.value = true; open.value = true;
title.value = "修改字典类型"; title.value = "修改字典类型";
@ -274,16 +353,16 @@ function handleUpdate(row) {
/** 提交按钮 */ /** 提交按钮 */
function submitForm() { function submitForm() {
proxy.$refs["dictRef"].validate(valid => { proxy.$refs["dictRef"].validate((valid) => {
if (valid) { if (valid) {
if (form.value.dictId != undefined) { if (form.value.dictId != undefined) {
updateType(form.value).then(response => { updateType(form.value).then((response) => {
proxy.$modal.msgSuccess("修改成功"); proxy.$modal.msgSuccess("修改成功");
open.value = false; open.value = false;
getList(); getList();
}); });
} else { } else {
addType(form.value).then(response => { addType(form.value).then((response) => {
proxy.$modal.msgSuccess("新增成功"); proxy.$modal.msgSuccess("新增成功");
open.value = false; open.value = false;
getList(); getList();
@ -296,19 +375,27 @@ function submitForm() {
/** 删除按钮操作 */ /** 删除按钮操作 */
function handleDelete(row) { function handleDelete(row) {
const dictIds = row.dictId || ids.value; const dictIds = row.dictId || ids.value;
proxy.$modal.confirm('是否确认删除字典编号为"' + dictIds + '"的数据项?').then(function() { proxy.$modal
return delType(dictIds); .confirm('是否确认删除字典编号为"' + dictIds + '"的数据项?')
}).then(() => { .then(function () {
getList(); return delType(dictIds);
proxy.$modal.msgSuccess("删除成功"); })
}).catch(() => {}); .then(() => {
getList();
proxy.$modal.msgSuccess("删除成功");
})
.catch(() => {});
} }
/** 导出按钮操作 */ /** 导出按钮操作 */
function handleExport() { function handleExport() {
proxy.download("system/dict/type/export", { proxy.download(
...queryParams.value "system/dict/type/export",
}, `dict_${new Date().getTime()}.xlsx`); {
...queryParams.value,
},
`dict_${new Date().getTime()}.xlsx`,
);
} }
/** 刷新缓存按钮操作 */ /** 刷新缓存按钮操作 */

118
src/views/task/form.vue

@ -0,0 +1,118 @@
<template>
<el-dialog :title="title" v-model="show" width="500px" append-to-body>
<el-form ref="roleRef" :model="form" :rules="rule" label-width="100px">
<el-form-item label="任务标题" prop="roleName">
<el-input v-model="form.roleName" placeholder="请输入任务标题" />
</el-form-item>
<el-form-item label="任务类型" prop="roleSort">
<el-select placeholder="请选择任务类型">
<el-option
v-for="dict in task_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="执行周期">
<el-select placeholder="请选择执行周期">
<el-option
v-for="dict in task_period_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="执行日期">
<el-date-picker
type="daterange"
range-separator="至"
start-placeholder="请选择开始日期"
end-placeholder="请选择结束日期"
/>
</el-form-item>
<el-form-item label="任务内容">
<el-input
type="textarea"
:autosize="{
minRows: 2,
}"
placeholder="请输入任务内容"
/>
</el-form-item>
</el-form>
<template #footer>
<div class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</template>
</el-dialog>
</template>
<script setup>
const title = ref("");
const show = ref(false);
const form = ref({});
const rule = ref({});
const { proxy } = getCurrentInstance();
const { task_period_type, task_type } = proxy.useDict(
"task_period_type",
"task_type",
);
/** 提交按钮 */
function submitForm() {
proxy.$refs["roleRef"].validate((valid) => {
if (valid) {
if (form.value.roleId != undefined) {
form.value.menuIds = getMenuAllCheckedKeys();
updateRole(form.value).then((response) => {
proxy.$modal.msgSuccess("修改成功");
open.value = false;
getList();
});
} else {
form.value.menuIds = getMenuAllCheckedKeys();
addRole(form.value).then((response) => {
proxy.$modal.msgSuccess("新增成功");
open.value = false;
getList();
});
}
}
});
}
/** 取消按钮 */
function cancel() {
show.value = false;
reset();
}
/** 重置新增的表单以及其他数据 */
function reset() {
form.value = {
roleId: undefined,
roleName: undefined,
roleKey: undefined,
roleSort: 0,
status: "0",
menuIds: [],
deptIds: [],
menuCheckStrictly: true,
deptCheckStrictly: true,
remark: undefined,
};
proxy.resetForm("roleRef");
}
function open(param) {
title.value = param.title;
show.value = true;
}
defineExpose({ open });
</script>
<style scoped lang="scss"></style>

206
src/views/task/index.vue

@ -0,0 +1,206 @@
<template>
<section class="app-container">
<el-form
:model="queryParams"
ref="queryRef"
v-show="showSearch"
:inline="true"
label-width="auto"
>
<el-form-item label="任务标题" prop="roleName">
<el-input
v-model="queryParams.roleName"
placeholder="请输入角色名称"
clearable
style="width: 240px"
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item label="权限字符" prop="roleKey">
<el-input
v-model="queryParams.roleKey"
placeholder="请输入权限字符"
clearable
style="width: 240px"
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item label="任务类型" prop="status">
<el-select
v-model="queryParams.status"
placeholder="角色状态"
clearable
style="width: 240px"
>
<el-option
v-for="dict in sys_normal_disable"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="创建时间" style="width: 308px">
<el-date-picker
v-model="dateRange"
value-format="YYYY-MM-DD"
type="daterange"
range-separator="-"
start-placeholder="开始日期"
end-placeholder="结束日期"
></el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="Search" @click="handleQuery">
搜索
</el-button>
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" plain icon="Plus" @click="create()"
>新增</el-button
>
</el-col>
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="warning"-->
<!-- plain-->
<!-- icon="Download"-->
<!-- @click="handleExport"-->
<!-- v-hasPermi="['system:role:export']"-->
<!-- >导出</el-button-->
<!-- >-->
<!-- </el-col>-->
<right-toolbar
v-model:showSearch="showSearch"
@queryTable="getList"
></right-toolbar>
</el-row>
<!-- 表格数据 -->
<el-table v-loading="loading" :data="list">
<el-table-column label="任务标题" prop="roleId" align="center" />
<el-table-column
label="执行周期"
prop="roleName"
:show-overflow-tooltip="true"
align="center"
/>
<el-table-column
label="任务类型"
prop="roleKey"
:show-overflow-tooltip="true"
align="center"
/>
<el-table-column
label="进度"
prop="roleKey"
:show-overflow-tooltip="true"
align="center"
/>
<el-table-column label="执行范围" prop="roleSort" align="center">
<template #default>
<el-link type="primary">共200家</el-link>
</template>
</el-table-column>
<el-table-column
label="操作"
align="center"
class-name="small-padding fixed-width"
>
<template #default="scope">
<el-tooltip content="执行日志" placement="top">
<el-button link type="primary" icon="Document"></el-button>
</el-tooltip>
<el-tooltip content="修改" placement="top">
<el-button link type="primary" icon="Edit"></el-button>
</el-tooltip>
<el-tooltip content="删除" placement="top">
<el-button link type="primary" icon="Delete"></el-button>
</el-tooltip>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
v-model:page="queryParams.pageNum"
v-model:limit="queryParams.pageSize"
@pagination="getList"
/>
<TaskForm ref="taskFormRef" />
</section>
</template>
<script setup>
import TaskForm from "./form.vue";
const { proxy } = getCurrentInstance();
const { task_period_type } = proxy.useDict("task_period_type");
const loading = ref(false);
const showSearch = ref(true);
const taskFormRef = ref();
const data = reactive({
form: {},
queryParams: {
pageNum: 1,
pageSize: 10,
roleName: undefined,
roleKey: undefined,
status: undefined,
},
rules: {
roleName: [
{ required: true, message: "角色名称不能为空", trigger: "blur" },
],
roleKey: [{ required: true, message: "权限字符不能为空", trigger: "blur" }],
roleSort: [
{ required: true, message: "角色顺序不能为空", trigger: "blur" },
],
},
});
const total = ref(0);
const { queryParams, form, rules } = toRefs(data);
const dateRange = ref([]);
const list = ref([
{
roleId: 1,
roleName: "超级管理员",
roleKey: "admin",
roleSort: 1,
roleStatus: "0",
roleRemark: "超级管理员拥有所有权限",
},
]);
/**
* 获取列表
*/
function getList() {}
/** 重置按钮操作 */
function resetQuery() {
dateRange.value = [];
proxy.resetForm("queryRef");
handleQuery();
}
/** 搜索按钮操作 */
function handleQuery() {
queryParams.value.pageNum = 1;
getList();
}
/**
* 新增任务
*/
function create() {
unref(taskFormRef).open({ title: "新增任务" });
}
</script>
<style scoped lang="scss"></style>

19
src/views/tool/componentview/index.vue

@ -0,0 +1,19 @@
<template>
<section class="app-container">
<el-form>
<el-form-item label="选择人员">
<ChoosePersonnel/>
</el-form-item>
</el-form>
</section>
</template>
<script setup>
import ChoosePersonnel from '@/BusinessCom/ChoosePersonnel/index.vue'
</script>
<style scoped lang="scss">
</style>

5
vite.config.js

@ -25,13 +25,14 @@ export default defineConfig(({ mode, command }) => {
}, },
// vite 相关配置 // vite 相关配置
server: { server: {
port: 8080, port: 9527,
host: true, host: true,
open: true, open: true,
proxy: { proxy: {
// https://cn.vitejs.dev/config/#server-proxy // https://cn.vitejs.dev/config/#server-proxy
'/api': { '/api': {
target: 'http://localhost:8080', // target:'http://192.168.2.101:8080',
target:'http://localhost:8888',
changeOrigin: true, changeOrigin: true,
rewrite: (p) => p.replace(/^\/dev-api/, '') rewrite: (p) => p.replace(/^\/dev-api/, '')
} }

Loading…
Cancel
Save