|
@@ -223,7 +223,13 @@
|
|
|
|
|
|
<script setup>
|
|
<script setup>
|
|
import { ref, watch } from "vue";
|
|
import { ref, watch } from "vue";
|
|
-import { formValidate, getArrValue, getObjValue, isNullES } from "js-fast-way";
|
|
|
|
|
|
+import {
|
|
|
|
+ deepClone,
|
|
|
|
+ formValidate,
|
|
|
|
+ getArrValue,
|
|
|
|
+ getObjValue,
|
|
|
|
+ isNullES,
|
|
|
|
+} from "js-fast-way";
|
|
import { getDictionaryData } from "~uti/tools";
|
|
import { getDictionaryData } from "~uti/tools";
|
|
import mainApi from "~api/project/tree";
|
|
import mainApi from "~api/project/tree";
|
|
import roleApi from "~api/system/role";
|
|
import roleApi from "~api/system/role";
|
|
@@ -299,13 +305,30 @@ const getTreeDetail = async (id) => {
|
|
...res,
|
|
...res,
|
|
id: id,
|
|
id: id,
|
|
nodeName: res.fullName,
|
|
nodeName: res.fullName,
|
|
- expDataType: isNullES(res.expDataType)
|
|
|
|
- ? []
|
|
|
|
- : res.expDataType.split(","),
|
|
|
|
- majorDataType: isNullES(res.majorDataType)
|
|
|
|
- ? []
|
|
|
|
- : res.majorDataType.split(","),
|
|
|
|
|
|
+ // expDataType: isNullES(res.expDataType)
|
|
|
|
+ // ? []
|
|
|
|
+ // : res.expDataType.split(","),
|
|
|
|
+ // majorDataType: isNullES(res.majorDataType)
|
|
|
|
+ // ? []
|
|
|
|
+ // : res.majorDataType.split(","),
|
|
};
|
|
};
|
|
|
|
+ if (!isNullES(res.expDataType)) {
|
|
|
|
+ let arr = data.expDataType.split(",");
|
|
|
|
+ const numberArray = Array.from(arr, Number);
|
|
|
|
+ formModel.value.expDataType = numberArray; //文件类型
|
|
|
|
+ } else {
|
|
|
|
+ formModel.value.expDataType = [];
|
|
|
|
+ }
|
|
|
|
+ if (!isNullES(res.majorDataType)) {
|
|
|
|
+ let arr = data.majorDataType.split(",");
|
|
|
|
+ const numberArray = Array.from(arr, Number);
|
|
|
|
+ formModel.value.majorDataType = numberArray;
|
|
|
|
+ } else {
|
|
|
|
+ formModel.value.majorDataType = [];
|
|
|
|
+ }
|
|
|
|
+ if (!isNullES(res.displayHierarchy)) {
|
|
|
|
+ formModel.value.displayHierarchy = Number(res.displayHierarchy);
|
|
|
|
+ }
|
|
};
|
|
};
|
|
|
|
|
|
//岗位类型
|
|
//岗位类型
|
|
@@ -387,7 +410,7 @@ const dialogSubmit = async () => {
|
|
const isForm = await formValidate(formRef.value);
|
|
const isForm = await formValidate(formRef.value);
|
|
if (!isForm) return;
|
|
if (!isForm) return;
|
|
const data = getObjValue(dataInfo.value);
|
|
const data = getObjValue(dataInfo.value);
|
|
- const form = formModel.value;
|
|
|
|
|
|
+ const form = deepClone(formModel.value);
|
|
if (data.postType !== form.postType) {
|
|
if (data.postType !== form.postType) {
|
|
window.$message.warning("岗位类型必须和父级节点岗位类型一致");
|
|
window.$message.warning("岗位类型必须和父级节点岗位类型一致");
|
|
return;
|
|
return;
|
|
@@ -395,13 +418,11 @@ const dialogSubmit = async () => {
|
|
submitLoading.value = true;
|
|
submitLoading.value = true;
|
|
if (formModel.value.majorDataType) {
|
|
if (formModel.value.majorDataType) {
|
|
form.majorDataType = form.majorDataType.join(",");
|
|
form.majorDataType = form.majorDataType.join(",");
|
|
- form.expDataType = form.expDataType.join(",");
|
|
|
|
}
|
|
}
|
|
if (formModel.value.expDataType) {
|
|
if (formModel.value.expDataType) {
|
|
form.expDataType = form.expDataType.join(",");
|
|
form.expDataType = form.expDataType.join(",");
|
|
}
|
|
}
|
|
- // form.majorDataType = form.majorDataType.join(",");
|
|
|
|
- // form.expDataType = form.expDataType.join(",");
|
|
|
|
|
|
+
|
|
//发起请求
|
|
//发起请求
|
|
let res = {};
|
|
let res = {};
|
|
if (props.type === "新增") {
|
|
if (props.type === "新增") {
|