staging #23
|
|
@ -8,20 +8,20 @@ const props = defineProps({
|
||||||
//** 传入的表单数据 */
|
//** 传入的表单数据 */
|
||||||
id: {
|
id: {
|
||||||
type: Number,
|
type: Number,
|
||||||
default: -1
|
default: -1,
|
||||||
},
|
},
|
||||||
tableData: {
|
tableData: {
|
||||||
type: Object as PropType<TableConfig>,
|
type: Object as PropType<TableConfig>,
|
||||||
default: null
|
default: null,
|
||||||
},
|
},
|
||||||
row: {
|
row: {
|
||||||
type: Object,
|
type: Object,
|
||||||
default: null
|
default: null,
|
||||||
},
|
},
|
||||||
tagData: {
|
tagData: {
|
||||||
type: Object,
|
type: Object,
|
||||||
default: () => {}
|
default: () => {},
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
const emit = defineEmits(["handlePagedCallback"]);
|
const emit = defineEmits(["handlePagedCallback"]);
|
||||||
const editFormRef = ref<FormInstance>();
|
const editFormRef = ref<FormInstance>();
|
||||||
|
|
@ -34,12 +34,12 @@ const editData = ref({
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
message: "不能为空",
|
message: "不能为空",
|
||||||
trigger: "blur"
|
trigger: "blur",
|
||||||
}
|
},
|
||||||
],
|
],
|
||||||
formLabelWidth: "120px",
|
formLabelWidth: "120px",
|
||||||
size: "small",
|
size: "small",
|
||||||
loading: false
|
loading: false,
|
||||||
});
|
});
|
||||||
const Api = new hTableAPI(editData.value.table.apiUrl);
|
const Api = new hTableAPI(editData.value.table.apiUrl);
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
|
@ -69,7 +69,7 @@ function handlePagedCallback() {
|
||||||
emit("handlePagedCallback"); // 传参给父组件
|
emit("handlePagedCallback"); // 传参给父组件
|
||||||
}
|
}
|
||||||
function handleSubmitForm() {
|
function handleSubmitForm() {
|
||||||
editFormRef.value.validate(valid => {
|
editFormRef.value.validate((valid) => {
|
||||||
if (!valid) {
|
if (!valid) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -88,7 +88,7 @@ function handleSubmitForm() {
|
||||||
if (editData.value.table.editCallback) {
|
if (editData.value.table.editCallback) {
|
||||||
editData.value.table.editCallback(form);
|
editData.value.table.editCallback(form);
|
||||||
}
|
}
|
||||||
Api.edit(form).then(res => {
|
Api.edit(form).then((res) => {
|
||||||
editData.value.loading = false;
|
editData.value.loading = false;
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
ElMessage.success("操作成功");
|
ElMessage.success("操作成功");
|
||||||
|
|
@ -105,7 +105,7 @@ function handleResetForm() {
|
||||||
if (Array.isArray(item.valueE)) {
|
if (Array.isArray(item.valueE)) {
|
||||||
item.valueE = [];
|
item.valueE = [];
|
||||||
} else if (typeof item.valueE === "number") {
|
} else if (typeof item.valueE === "number") {
|
||||||
item.valueE = 0;
|
item.valueE = "";
|
||||||
} else if (typeof item.valueE === "boolean") {
|
} else if (typeof item.valueE === "boolean") {
|
||||||
item.valueE = false;
|
item.valueE = false;
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -118,7 +118,7 @@ function fetchFormData() {
|
||||||
editData.value.loading = false;
|
editData.value.loading = false;
|
||||||
if (editData.value.isedit) {
|
if (editData.value.isedit) {
|
||||||
handleResetForm();
|
handleResetForm();
|
||||||
Api.Info(props.id).then(res => {
|
Api.Info(props.id).then((res) => {
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
editData.value.frorm = res.data;
|
editData.value.frorm = res.data;
|
||||||
for (const key in column.value) {
|
for (const key in column.value) {
|
||||||
|
|
@ -201,19 +201,12 @@ function fetchFormData() {
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div v-else>
|
<div v-else>
|
||||||
<el-input
|
<el-input v-model="o.valueE as string" class="elWidth" :placeholder="o.label" />
|
||||||
v-model="o.valueE as string"
|
|
||||||
class="elWidth"
|
|
||||||
:placeholder="o.label"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button
|
<el-button type="primary" :loading="!editData.loading" @click="handleSubmitForm()"
|
||||||
type="primary"
|
|
||||||
:loading="!editData.loading"
|
|
||||||
@click="handleSubmitForm()"
|
|
||||||
>立即提交</el-button
|
>立即提交</el-button
|
||||||
>
|
>
|
||||||
<el-button @click="handleResetForm()">重置</el-button>
|
<el-button @click="handleResetForm()">重置</el-button>
|
||||||
|
|
|
||||||
|
|
@ -185,6 +185,9 @@ function handleAdd() {
|
||||||
dialog.value.edit.visible = true;
|
dialog.value.edit.visible = true;
|
||||||
dialog.value.visible = true;
|
dialog.value.visible = true;
|
||||||
dialog.value.width = "500px";
|
dialog.value.width = "500px";
|
||||||
|
|
||||||
|
dialog.value.edit.row = null;
|
||||||
|
dialog.value.edit.tagData = null;
|
||||||
}
|
}
|
||||||
function handleEdit(obj, row) {
|
function handleEdit(obj, row) {
|
||||||
dialog.value.edit.id = row[0].id;
|
dialog.value.edit.id = row[0].id;
|
||||||
|
|
@ -246,8 +249,23 @@ function handleAddCallback() {
|
||||||
dialog.value.visible = false;
|
dialog.value.visible = false;
|
||||||
dialog.value.edit.visible = false;
|
dialog.value.edit.visible = false;
|
||||||
dialog.value.custom.visible = false;
|
dialog.value.custom.visible = false;
|
||||||
|
|
||||||
|
handleResetForm();
|
||||||
handleReloadPaged();
|
handleReloadPaged();
|
||||||
}
|
}
|
||||||
|
function handleResetForm() {
|
||||||
|
for (const key in table.value.column) {
|
||||||
|
let item = table.value.column[key];
|
||||||
|
if (Array.isArray(item.valueE)) {
|
||||||
|
item.valueE = [];
|
||||||
|
} else if (typeof item.valueE === "number") {
|
||||||
|
item.valueE = "";
|
||||||
|
} else if (typeof item.valueE === "boolean") {
|
||||||
|
} else {
|
||||||
|
item.valueE = "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
function tableClose() {
|
function tableClose() {
|
||||||
handleAddCallback();
|
handleAddCallback();
|
||||||
}
|
}
|
||||||
|
|
@ -265,6 +283,19 @@ function handleSelectionChange(selection) {
|
||||||
|
|
||||||
table.value.selectRows = selection;
|
table.value.selectRows = selection;
|
||||||
}
|
}
|
||||||
|
function searchReload() {
|
||||||
|
for (let name in table.value.column) {
|
||||||
|
if (
|
||||||
|
!table.value.column[name].search ||
|
||||||
|
table.value.column[name].value === undefined ||
|
||||||
|
table.value.column[name].value === null ||
|
||||||
|
table.value.column[name].value === ""
|
||||||
|
) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
table.value.column[name].value = "";
|
||||||
|
}
|
||||||
|
}
|
||||||
// 查询
|
// 查询
|
||||||
function handleReloadPaged(reload = true) {
|
function handleReloadPaged(reload = true) {
|
||||||
if (table.value.search === undefined || table.value.search.PageIndex === undefined) {
|
if (table.value.search === undefined || table.value.search.PageIndex === undefined) {
|
||||||
|
|
@ -429,6 +460,8 @@ function fetchPagedData() {
|
||||||
<el-button type="primary" :icon="Search" @click="handleReloadPaged(false)"
|
<el-button type="primary" :icon="Search" @click="handleReloadPaged(false)"
|
||||||
>查询</el-button
|
>查询</el-button
|
||||||
>
|
>
|
||||||
|
|
||||||
|
<el-button type="default" @click="searchReload()">重置</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,14 @@ export const ruleRequiredI = (max: number = 20, min: number = 0): Rule[] => {
|
||||||
res.push({ min: min, message: `长度不能小于${min}`, trigger: "blur" });
|
res.push({ min: min, message: `长度不能小于${min}`, trigger: "blur" });
|
||||||
return res;
|
return res;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const ruleNumber = [
|
||||||
|
{
|
||||||
|
pattern: /^\d*\.?\d+$/,
|
||||||
|
message: "请输入正确数字",
|
||||||
|
trigger: "blur"
|
||||||
|
}
|
||||||
|
];
|
||||||
export const ruleRequiredNumber = [
|
export const ruleRequiredNumber = [
|
||||||
{ required: true, message: "不能为空", trigger: "blur" },
|
{ required: true, message: "不能为空", trigger: "blur" },
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -43,13 +43,6 @@ const tableData: TableConfig = {
|
||||||
},
|
},
|
||||||
operationColumn: true, // 显示操作按钮
|
operationColumn: true, // 显示操作按钮
|
||||||
operationColumnData: [
|
operationColumnData: [
|
||||||
{
|
|
||||||
// 操作按钮
|
|
||||||
topBtn: true, // 是头部按钮
|
|
||||||
label: "添加",
|
|
||||||
btnStyle: "success",
|
|
||||||
btnType: "custom",
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
topBtn: false, // 头部按钮
|
topBtn: false, // 头部按钮
|
||||||
show: true,
|
show: true,
|
||||||
|
|
@ -91,7 +84,6 @@ const tableData: TableConfig = {
|
||||||
grade: {
|
grade: {
|
||||||
label: "年级",
|
label: "年级",
|
||||||
width: "100px",
|
width: "100px",
|
||||||
custom: (s) => `${s.gradeYear}${s.gradeLevel}`,
|
|
||||||
search: true,
|
search: true,
|
||||||
add: false, // 字段允许添加
|
add: false, // 字段允许添加
|
||||||
edit: false, // 字段允许修改
|
edit: false, // 字段允许修改
|
||||||
|
|
@ -121,7 +113,7 @@ const tableData: TableConfig = {
|
||||||
createTime: {
|
createTime: {
|
||||||
label: "录入时间",
|
label: "录入时间",
|
||||||
width: "200px",
|
width: "200px",
|
||||||
search: true,
|
search: false,
|
||||||
add: false, // 字段允许添加
|
add: false, // 字段允许添加
|
||||||
edit: false, // 字段允许修改
|
edit: false, // 字段允许修改
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -83,8 +83,8 @@ const tableData: TableConfig = {
|
||||||
grade: {
|
grade: {
|
||||||
label: "年级",
|
label: "年级",
|
||||||
search: true,
|
search: true,
|
||||||
type: "dropdown",
|
// type: "dropdown",
|
||||||
setting: {},
|
// setting: {},
|
||||||
width: "60px",
|
width: "60px",
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -148,8 +148,11 @@ const tableData: TableConfig = {
|
||||||
const showTable = ref(false);
|
const showTable = ref(false);
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
//初始化数据原
|
//初始化数据原
|
||||||
|
// tableData.column.grade.setting.datasource = (await getenum("GradeEnum")).data.map(
|
||||||
tableData.column.grade.setting.datasource = (await getenum("GradeEnum")).data;
|
// (x) => {
|
||||||
|
// return { text: x.text, value: x.text };
|
||||||
|
// }
|
||||||
|
// );
|
||||||
|
|
||||||
tableData.column.testPaperType.setting.datasource = (
|
tableData.column.testPaperType.setting.datasource = (
|
||||||
await getenum("TestPaperTypeEnum")
|
await getenum("TestPaperTypeEnum")
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ import { onMounted, ref } from "vue";
|
||||||
import { fa } from "element-plus/es/locales.mjs";
|
import { fa } from "element-plus/es/locales.mjs";
|
||||||
import { hTableAPI } from "@/api/hTable";
|
import { hTableAPI } from "@/api/hTable";
|
||||||
import { getenum } from "@/api/enum";
|
import { getenum } from "@/api/enum";
|
||||||
import { ruleRequired, ruleRequiredNumber } from "@/utils/rules";
|
import { ruleNumber, ruleRequired, ruleRequiredNumber } from "@/utils/rules";
|
||||||
import { ImportExamInfo } from "@/api/exam";
|
import { ImportExamInfo } from "@/api/exam";
|
||||||
import { ElMessage } from "element-plus";
|
import { ElMessage } from "element-plus";
|
||||||
import { entryExamInfo } from "./examFun";
|
import { entryExamInfo } from "./examFun";
|
||||||
|
|
@ -133,19 +133,17 @@ const tableData: TableConfig = {
|
||||||
},
|
},
|
||||||
scoreLine: {
|
scoreLine: {
|
||||||
label: "划线分数",
|
label: "划线分数",
|
||||||
rules: ruleRequiredNumber,
|
rules: ruleNumber,
|
||||||
search: true,
|
search: false,
|
||||||
width: "100px",
|
width: "100px",
|
||||||
setting: {},
|
|
||||||
add: true, // 字段允许添加
|
add: true, // 字段允许添加
|
||||||
edit: true, // 字段允许修改
|
edit: true, // 字段允许修改
|
||||||
},
|
},
|
||||||
baseSchoolScore: {
|
baseSchoolScore: {
|
||||||
label: "资源校平均分",
|
label: "资源校平均分",
|
||||||
// rules: ruleRequiredNumber,
|
rules: ruleNumber,
|
||||||
search: true,
|
search: false,
|
||||||
width: "150px",
|
width: "150px",
|
||||||
setting: {},
|
|
||||||
add: true, // 字段允许添加
|
add: true, // 字段允许添加
|
||||||
edit: true, // 字段允许修改
|
edit: true, // 字段允许修改
|
||||||
},
|
},
|
||||||
|
|
@ -162,7 +160,7 @@ const tableData: TableConfig = {
|
||||||
createTime: {
|
createTime: {
|
||||||
label: "创建时间",
|
label: "创建时间",
|
||||||
type: "datetime",
|
type: "datetime",
|
||||||
search: true,
|
search: false,
|
||||||
add: false, // 字段允许添加
|
add: false, // 字段允许添加
|
||||||
edit: false, // 字段允许修改
|
edit: false, // 字段允许修改
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -6,11 +6,7 @@
|
||||||
:label-width="eData.formLabelWidth"
|
:label-width="eData.formLabelWidth"
|
||||||
clearable
|
clearable
|
||||||
>
|
>
|
||||||
<el-form-item
|
<el-form-item label="学校名称:" prop="Name" :rules="eData.rules.Required">
|
||||||
label="学校名称:"
|
|
||||||
prop="Name"
|
|
||||||
:rules="eData.rules.Required"
|
|
||||||
>
|
|
||||||
<el-input
|
<el-input
|
||||||
@change="inputChange"
|
@change="inputChange"
|
||||||
type="text"
|
type="text"
|
||||||
|
|
@ -27,7 +23,7 @@
|
||||||
<el-select
|
<el-select
|
||||||
v-model="eData.form.pid"
|
v-model="eData.form.pid"
|
||||||
clearable
|
clearable
|
||||||
@change="v => selectChange(v, 1)"
|
@change="(v) => selectChange(v, 1)"
|
||||||
filterable
|
filterable
|
||||||
placeholder="省份"
|
placeholder="省份"
|
||||||
style="width: 180px"
|
style="width: 180px"
|
||||||
|
|
@ -45,7 +41,7 @@
|
||||||
<el-select
|
<el-select
|
||||||
v-model="eData.form.cid"
|
v-model="eData.form.cid"
|
||||||
clearable
|
clearable
|
||||||
@change="v => selectChange(v, 2)"
|
@change="(v) => selectChange(v, 2)"
|
||||||
filterable
|
filterable
|
||||||
placeholder="市"
|
placeholder="市"
|
||||||
style="width: 180px"
|
style="width: 180px"
|
||||||
|
|
@ -63,7 +59,7 @@
|
||||||
<el-select
|
<el-select
|
||||||
v-model="eData.form.rid"
|
v-model="eData.form.rid"
|
||||||
clearable
|
clearable
|
||||||
@change="v => selectChange(v, 3)"
|
@change="(v) => selectChange(v, 3)"
|
||||||
filterable
|
filterable
|
||||||
placeholder="区"
|
placeholder="区"
|
||||||
style="width: 180px"
|
style="width: 180px"
|
||||||
|
|
@ -82,21 +78,14 @@
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item label="启用:" prop="Enable">
|
<el-form-item label="启用:" prop="Enable">
|
||||||
<el-switch
|
<el-switch v-model="eData.form.Enable" active-text="启用" inactive-text="禁用">
|
||||||
v-model="eData.form.Enable"
|
|
||||||
active-text="启用"
|
|
||||||
inactive-text="禁用"
|
|
||||||
>
|
|
||||||
</el-switch>
|
</el-switch>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<div style="padding-left: 4rem">
|
<div style="padding-left: 4rem">
|
||||||
<br />
|
<br />
|
||||||
</div>
|
</div>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button
|
<el-button type="primary" :loading="eData.loading" @click="handleSubmitForm()"
|
||||||
type="primary"
|
|
||||||
:loading="eData.loading"
|
|
||||||
@click="handleSubmitForm()"
|
|
||||||
>立即提交</el-button
|
>立即提交</el-button
|
||||||
>
|
>
|
||||||
<el-button @click="handleResetForm()">重置</el-button>
|
<el-button @click="handleResetForm()">重置</el-button>
|
||||||
|
|
@ -113,12 +102,12 @@ import { onMounted, ref } from "vue";
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
id: {
|
id: {
|
||||||
type: Number,
|
type: Number,
|
||||||
default: -1
|
default: -1,
|
||||||
},
|
},
|
||||||
row: {
|
row: {
|
||||||
type: Object as PropType<any[]>,
|
type: Object as PropType<any[]>,
|
||||||
default: null
|
default: null,
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const eData = ref({
|
const eData = ref({
|
||||||
|
|
@ -129,8 +118,8 @@ const eData = ref({
|
||||||
Required: {
|
Required: {
|
||||||
required: true,
|
required: true,
|
||||||
message: "必填项",
|
message: "必填项",
|
||||||
trigger: "blur"
|
trigger: "blur",
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
formLabelWidth: "120px",
|
formLabelWidth: "120px",
|
||||||
size: "small",
|
size: "small",
|
||||||
|
|
@ -144,8 +133,8 @@ const eData = ref({
|
||||||
pname: "",
|
pname: "",
|
||||||
cname: "",
|
cname: "",
|
||||||
rname: "",
|
rname: "",
|
||||||
Enable: true
|
Enable: true,
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
fetchInitData();
|
fetchInitData();
|
||||||
|
|
@ -159,7 +148,7 @@ async function selectChange(value, index) {
|
||||||
let loc = eData.value.LocaArr2;
|
let loc = eData.value.LocaArr2;
|
||||||
if (index == 1) {
|
if (index == 1) {
|
||||||
eData.value.form.pname =
|
eData.value.form.pname =
|
||||||
value == "" ? "" : eData.value.LocaArr1.find(s => s.Value == value).Text;
|
value == "" ? "" : eData.value.LocaArr1.find((s) => s.Value == value).Text;
|
||||||
eData.value.form.cname = "";
|
eData.value.form.cname = "";
|
||||||
eData.value.form.rname = "";
|
eData.value.form.rname = "";
|
||||||
eData.value.form.cid = "";
|
eData.value.form.cid = "";
|
||||||
|
|
@ -168,40 +157,34 @@ async function selectChange(value, index) {
|
||||||
loc = eData.value.LocaArr3;
|
loc = eData.value.LocaArr3;
|
||||||
GetInfo = getregion;
|
GetInfo = getregion;
|
||||||
eData.value.form.cname =
|
eData.value.form.cname =
|
||||||
value == "" ? "" : eData.value.LocaArr2.find(s => s.Value == value).Text;
|
value == "" ? "" : eData.value.LocaArr2.find((s) => s.Value == value).Text;
|
||||||
eData.value.form.rname = "";
|
eData.value.form.rname = "";
|
||||||
eData.value.form.rid = "";
|
eData.value.form.rid = "";
|
||||||
} else {
|
} else {
|
||||||
eData.value.form.rname =
|
eData.value.form.rname =
|
||||||
value == "" ? "" : eData.value.LocaArr3.find(s => s.Value == value).Text;
|
value == "" ? "" : eData.value.LocaArr3.find((s) => s.Value == value).Text;
|
||||||
}
|
}
|
||||||
if (value == "" && index == 3) return;
|
if (value == "" && index == 3) return;
|
||||||
let nodes = (await GetInfo(nid)).data.map(item => ({
|
let nodes = (await GetInfo(nid)).data.map((item) => ({
|
||||||
Value: item.rid || item.cid || item.pid,
|
Value: item.rid || item.cid || item.pid,
|
||||||
Text: item.rname || item.cname || item.pname
|
Text: item.rname || item.cname || item.pname,
|
||||||
}));
|
}));
|
||||||
loc.splice(0, loc.length);
|
loc.splice(0, loc.length);
|
||||||
loc.push(...nodes);
|
loc.push(...nodes);
|
||||||
}
|
}
|
||||||
async function inputChange() {
|
async function inputChange() {
|
||||||
if (eData.value.form.pname == "") {
|
if (eData.value.form.pname == "") {
|
||||||
let p = eData.value.LocaArr1.find(s =>
|
let p = eData.value.LocaArr1.find((s) => eData.value.form.Name.includes(s.Text));
|
||||||
eData.value.form.Name.includes(s.Text)
|
|
||||||
);
|
|
||||||
if (!p) return;
|
if (!p) return;
|
||||||
eData.value.form.pid = p.Value;
|
eData.value.form.pid = p.Value;
|
||||||
await selectChange(eData.value.form.pid, 1);
|
await selectChange(eData.value.form.pid, 1);
|
||||||
|
|
||||||
let p1 = eData.value.LocaArr2.find(s =>
|
let p1 = eData.value.LocaArr2.find((s) => eData.value.form.Name.includes(s.Text));
|
||||||
eData.value.form.Name.includes(s.Text)
|
|
||||||
);
|
|
||||||
if (!p1) return;
|
if (!p1) return;
|
||||||
eData.value.form.cid = p1.Value;
|
eData.value.form.cid = p1.Value;
|
||||||
await selectChange(eData.value.form.cid, 2);
|
await selectChange(eData.value.form.cid, 2);
|
||||||
|
|
||||||
let p2 = eData.value.LocaArr3.find(s =>
|
let p2 = eData.value.LocaArr3.find((s) => eData.value.form.Name.includes(s.Text));
|
||||||
eData.value.form.Name.includes(s.Text)
|
|
||||||
);
|
|
||||||
if (!p2) return;
|
if (!p2) return;
|
||||||
eData.value.form.rid = p2.Value;
|
eData.value.form.rid = p2.Value;
|
||||||
await selectChange(eData.value.form.rid, 3);
|
await selectChange(eData.value.form.rid, 3);
|
||||||
|
|
@ -214,18 +197,17 @@ function handlePagedCallback() {
|
||||||
}
|
}
|
||||||
const schoolAddForm = ref<FormInstance>();
|
const schoolAddForm = ref<FormInstance>();
|
||||||
function handleSubmitForm() {
|
function handleSubmitForm() {
|
||||||
schoolAddForm.value.validate(valid => {
|
schoolAddForm.value.validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
eData.value.loading = true;
|
eData.value.loading = true;
|
||||||
let ids = ["pid", "cid", "rid"];
|
let ids = ["pid", "cid", "rid"];
|
||||||
for (const key of ids) {
|
for (const key of ids) {
|
||||||
eData.value.form[key] =
|
eData.value.form[key] = eData.value.form[key] == "" ? 0 : eData.value.form[key];
|
||||||
eData.value.form[key] == "" ? 0 : eData.value.form[key];
|
|
||||||
}
|
}
|
||||||
if (!(props.id !== -1)) {
|
if (!(props.id !== -1)) {
|
||||||
eData.value.form.id = 0;
|
eData.value.form.id = 0;
|
||||||
}
|
}
|
||||||
EditSchool(eData.value.form).then(res => {
|
EditSchool(eData.value.form).then((res) => {
|
||||||
eData.value.loading = false;
|
eData.value.loading = false;
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
ElMessage.success("操作成功");
|
ElMessage.success("操作成功");
|
||||||
|
|
@ -237,11 +219,19 @@ function handleSubmitForm() {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
function handleResetForm() {}
|
function handleResetForm() {
|
||||||
|
schoolAddForm.value.resetFields();
|
||||||
|
eData.value.form.pid = "";
|
||||||
|
eData.value.form.cid = "";
|
||||||
|
eData.value.form.rid = "";
|
||||||
|
eData.value.form.pname = "";
|
||||||
|
eData.value.form.cname = "";
|
||||||
|
eData.value.form.rname = "";
|
||||||
|
}
|
||||||
async function fetchInitData() {
|
async function fetchInitData() {
|
||||||
eData.value.LocaArr1 = (await getProvince()).data.map(item => ({
|
eData.value.LocaArr1 = (await getProvince()).data.map((item) => ({
|
||||||
Value: item.rid || item.cid || item.pid,
|
Value: item.rid || item.cid || item.pid,
|
||||||
Text: item.rname || item.cname || item.pname
|
Text: item.rname || item.cname || item.pname,
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,9 @@ defineOptions({
|
||||||
});
|
});
|
||||||
|
|
||||||
onMounted(() => {});
|
onMounted(() => {});
|
||||||
function searchCallback(data) {}
|
function searchCallback(data) {
|
||||||
|
//let c = data.Conditions.find((s) => s.FieldName == "Pname");
|
||||||
|
}
|
||||||
const table = ref<{ initTable: (config: TableConfig) => void }>(null);
|
const table = ref<{ initTable: (config: TableConfig) => void }>(null);
|
||||||
const tableData: TableConfig = {
|
const tableData: TableConfig = {
|
||||||
apiUrl: "usercenter/back/schools",
|
apiUrl: "usercenter/back/schools",
|
||||||
|
|
@ -63,10 +65,10 @@ const tableData: TableConfig = {
|
||||||
add: true, // 字段允许添加
|
add: true, // 字段允许添加
|
||||||
edit: true, // 字段允许修改
|
edit: true, // 字段允许修改
|
||||||
},
|
},
|
||||||
loc: {
|
pname: {
|
||||||
label: "地区",
|
label: "地区",
|
||||||
width: "300px",
|
width: "300px",
|
||||||
search: true,
|
search: false,
|
||||||
custom: (row) => `${row.pname}-${row.cname}-${row.rname}`,
|
custom: (row) => `${row.pname}-${row.cname}-${row.rname}`,
|
||||||
add: false, // 字段允许添加
|
add: false, // 字段允许添加
|
||||||
edit: false, // 字段允许修改
|
edit: false, // 字段允许修改
|
||||||
|
|
|
||||||
|
|
@ -88,6 +88,8 @@
|
||||||
<el-button type="primary" @click="handleReloadPaged" :icon="Search"
|
<el-button type="primary" @click="handleReloadPaged" :icon="Search"
|
||||||
>查询</el-button
|
>查询</el-button
|
||||||
>
|
>
|
||||||
|
|
||||||
|
<el-button type="default" @click="searchReload">重置</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -549,6 +551,11 @@ const handleSelectionChange = (selection: UserDetail[]) => {
|
||||||
table.selectRows = selection;
|
table.selectRows = selection;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
function searchReload() {
|
||||||
|
for (const key in search) {
|
||||||
|
search[key] = "";
|
||||||
|
}
|
||||||
|
}
|
||||||
const handleDelete = () => {
|
const handleDelete = () => {
|
||||||
// if (table.selectRows.length === 0) {
|
// if (table.selectRows.length === 0) {
|
||||||
// ElMessage.warning("未勾选记录");
|
// ElMessage.warning("未勾选记录");
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
<div class="app-container" style="padding: 5px">
|
<div class="app-container" style="padding: 5px">
|
||||||
<div class="search-container" style="padding-top: 5px">
|
<div class="search-container" style="padding-top: 5px">
|
||||||
<!-- 搜索项目 -->
|
<!-- 搜索项目 -->
|
||||||
<el-form :inline="true" :model="search">
|
<el-form ref="searchForm" :inline="true" :model="search">
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-input v-model="search.searchStr" placeholder="姓名/账号/学号" />
|
<el-input v-model="search.searchStr" placeholder="姓名/账号/学号" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
@ -100,6 +100,7 @@
|
||||||
<el-button type="primary" @click="handleReloadPaged" :icon="Search"
|
<el-button type="primary" @click="handleReloadPaged" :icon="Search"
|
||||||
>查询</el-button
|
>查询</el-button
|
||||||
>
|
>
|
||||||
|
<el-button type="default" @click="searchReload">重置</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item v-show="selectUser">
|
<el-form-item v-show="selectUser">
|
||||||
<el-button type="success" @click="selectUserCallBack()" icon="el-icon-check"
|
<el-button type="success" @click="selectUserCallBack()" icon="el-icon-check"
|
||||||
|
|
@ -236,7 +237,7 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, reactive, onMounted } from "vue";
|
import { ref, reactive, onMounted } from "vue";
|
||||||
import { ElMessage, ElMessageBox } from "element-plus";
|
import { ElMessage, ElMessageBox } from "element-plus";
|
||||||
import type { UploadProps } from "element-plus";
|
import type { FormInstance, UploadProps } from "element-plus";
|
||||||
import UserForm from "./edit.vue";
|
import UserForm from "./edit.vue";
|
||||||
|
|
||||||
import {
|
import {
|
||||||
|
|
@ -347,6 +348,7 @@ const baseUrl = import.meta.env.VITE_API_USERCENTER_URL;
|
||||||
const excelImportUsersUrl = `${baseUrl}/back/users/downloadimportusersexceltemplate`;
|
const excelImportUsersUrl = `${baseUrl}/back/users/downloadimportusersexceltemplate`;
|
||||||
const excelImportMeetingUrl = `${baseUrl}/back/users/downloadimportmeetingexceltemplate`;
|
const excelImportMeetingUrl = `${baseUrl}/back/users/downloadimportmeetingexceltemplate`;
|
||||||
const excelImportOrdersUrl = `${baseUrl}/back/users/downloadimportordersexceltemplate`;
|
const excelImportOrdersUrl = `${baseUrl}/back/users/downloadimportordersexceltemplate`;
|
||||||
|
const searchForm = ref<FormInstance>();
|
||||||
|
|
||||||
const editId = ref(0);
|
const editId = ref(0);
|
||||||
const showAllPosition = ref<UserDetail[]>([]);
|
const showAllPosition = ref<UserDetail[]>([]);
|
||||||
|
|
@ -618,6 +620,11 @@ const PositionsSort = (arr: Position[]) => {
|
||||||
return arr;
|
return arr;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
function searchReload() {
|
||||||
|
for (const key in search) {
|
||||||
|
search[key] = "";
|
||||||
|
}
|
||||||
|
}
|
||||||
const handleReloadPaged = (event?: any, searchUnUse?: boolean) => {
|
const handleReloadPaged = (event?: any, searchUnUse?: boolean) => {
|
||||||
pagination.index = 1;
|
pagination.index = 1;
|
||||||
table.selectRows = [];
|
table.selectRows = [];
|
||||||
|
|
|
||||||
|
|
@ -157,7 +157,7 @@
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
<div style="font-weight: bold; color: #409eff">
|
<div style="font-weight: bold; color: #409eff">
|
||||||
执行记录{{ index + 1 }}:{{ record.time }}
|
执行记录{{ index + 1 }}:{{ record.operator }} {{ record.time }}
|
||||||
</div>
|
</div>
|
||||||
<div style="margin-top: 5px; white-space: pre-wrap">
|
<div style="margin-top: 5px; white-space: pre-wrap">
|
||||||
{{ record.content }}
|
{{ record.content }}
|
||||||
|
|
@ -209,6 +209,8 @@
|
||||||
v-model="operationForm.operationContent"
|
v-model="operationForm.operationContent"
|
||||||
type="textarea"
|
type="textarea"
|
||||||
:rows="4"
|
:rows="4"
|
||||||
|
maxlength="300"
|
||||||
|
show-word-limit
|
||||||
:placeholder="`请输入${operationContentLabel}`"
|
:placeholder="`请输入${operationContentLabel}`"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
@ -230,6 +232,8 @@ import { ElMessage } from "element-plus";
|
||||||
import { getSchoolData } from "@/api/userCenter";
|
import { getSchoolData } from "@/api/userCenter";
|
||||||
import { getSchoolBusinessPeopleListApi, addOrEditApi } from "@/api/toschoolinfomanage";
|
import { getSchoolBusinessPeopleListApi, addOrEditApi } from "@/api/toschoolinfomanage";
|
||||||
import { setFips } from "crypto";
|
import { setFips } from "crypto";
|
||||||
|
import { useUserStoreHook } from "@/store/modules/user";
|
||||||
|
import { isAllEmpty } from "@pureadmin/utils";
|
||||||
|
|
||||||
const activeName = ref<any>(0);
|
const activeName = ref<any>(0);
|
||||||
|
|
||||||
|
|
@ -258,7 +262,9 @@ const operationForm = reactive({
|
||||||
const operationFormRef = ref<FormInstance>();
|
const operationFormRef = ref<FormInstance>();
|
||||||
|
|
||||||
// 执行记录和完结情况数据
|
// 执行记录和完结情况数据
|
||||||
const executionRecords = ref<Array<{ time: string; content: string }>>([]);
|
const executionRecords = ref<Array<{ time: string; content: string; operator?: string }>>(
|
||||||
|
[]
|
||||||
|
);
|
||||||
const finishRecord = ref<{ time: string; content: string } | null>(null);
|
const finishRecord = ref<{ time: string; content: string } | null>(null);
|
||||||
|
|
||||||
// 从父级 detailData.solutionRecord 回显本地显示数据
|
// 从父级 detailData.solutionRecord 回显本地显示数据
|
||||||
|
|
@ -271,6 +277,7 @@ watch(
|
||||||
executionRecords.value = recs.map((r: any) => ({
|
executionRecords.value = recs.map((r: any) => ({
|
||||||
time: r?.executionTimeStr || r?.executionTime || "",
|
time: r?.executionTimeStr || r?.executionTime || "",
|
||||||
content: r?.executionRecords || "",
|
content: r?.executionRecords || "",
|
||||||
|
operator: r?.operator || "",
|
||||||
}));
|
}));
|
||||||
// 完结情况回显
|
// 完结情况回显
|
||||||
if (sr?.endRecordTime || sr?.endRecord) {
|
if (sr?.endRecordTime || sr?.endRecord) {
|
||||||
|
|
@ -443,9 +450,15 @@ const confirmOperation = async () => {
|
||||||
if (!props.detailData.solutionRecord) props.detailData.solutionRecord = {} as any;
|
if (!props.detailData.solutionRecord) props.detailData.solutionRecord = {} as any;
|
||||||
if (!Array.isArray(props.detailData.solutionRecord.record))
|
if (!Array.isArray(props.detailData.solutionRecord.record))
|
||||||
props.detailData.solutionRecord.record = [];
|
props.detailData.solutionRecord.record = [];
|
||||||
|
const userName = computed(() => {
|
||||||
|
return isAllEmpty(useUserStoreHook()?.nickName)
|
||||||
|
? useUserStoreHook()?.userName
|
||||||
|
: useUserStoreHook()?.nickName;
|
||||||
|
});
|
||||||
props.detailData.solutionRecord.record.push({
|
props.detailData.solutionRecord.record.push({
|
||||||
executionTime: operationTime,
|
executionTime: operationTime,
|
||||||
executionRecords: operationContent,
|
executionRecords: operationContent,
|
||||||
|
operator: userName.value,
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
case "addFinish":
|
case "addFinish":
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue