diff --git a/src/api/flow/statistic.js b/src/api/flow/statistic.js
new file mode 100644
index 0000000..f66c7d5
--- /dev/null
+++ b/src/api/flow/statistic.js
@@ -0,0 +1,8 @@
+import request from "@/utils/request";
+export function statistic(name, params) {
+ return request({
+ method: 'get',
+ url: `/api/oa/flow-statistic/${name}`,
+ params
+ })
+}
diff --git a/src/components/MobileMultipleSelect/index.vue b/src/components/MobileMultipleSelect/index.vue
index 9a06144..f0be3da 100644
--- a/src/components/MobileMultipleSelect/index.vue
+++ b/src/components/MobileMultipleSelect/index.vue
@@ -1,20 +1,20 @@
-
+
@@ -42,12 +43,12 @@ import {
fieldConfig,
view,
} from "@/api/flow";
-import MobileForm from "@/views/flow/MobileForm.vue";
+import DesktopForm from "@/views/flow/DesktopForm.vue";
import { PopupManager } from 'element-ui/lib/utils/popup'
export default {
components: {
- MobileForm
+ DesktopForm
},
props: {
isShow: {
diff --git a/src/views/flow/components/assign.vue b/src/views/flow/components/assign.vue
index f2eaf27..25b7d0c 100644
--- a/src/views/flow/components/assign.vue
+++ b/src/views/flow/components/assign.vue
@@ -57,7 +57,7 @@
{{ group.name }}
-
{{ user.name }}
+
{{ user.name }}
diff --git a/src/views/flow/create.vue b/src/views/flow/create.vue
index e3f6025..6c63b63 100644
--- a/src/views/flow/create.vue
+++ b/src/views/flow/create.vue
@@ -47,40 +47,21 @@
-
-
-
-
-
-
+
@@ -468,7 +449,6 @@ export default {
}
},
trigger: "blur",
- pattern: validation.get(rule),
message: `${field.label}必须为${validationName.get(rule)}`,
};
}
@@ -484,7 +464,7 @@ export default {
};
default:
return {
- validator: ({ cellValue }) => {
+ validator: this.device === 'desktop' ? ({ cellValue }) => {
return new Promise((resolve, reject) => {
if (validation.get(rule).test(cellValue) || cellValue === '') {
resolve()
@@ -496,6 +476,16 @@ export default {
);
}
})
+ } : (myRule, value, callback) => {
+ if (validation.get(rule).test(value) || value === '') {
+ callback();
+ } else {
+ callback(
+ new Error(
+ `${field.label}必须为${validationName.get(rule)}`
+ )
+ );
+ }
},
trigger: "blur",
pattern: validation.get(rule),
@@ -506,7 +496,9 @@ export default {
}
if (field.type === "relation") {
this.subRules[`${field.name}_rules`] = {}
- object[field.name] = [{}];
+ let temp = {}
+ this.subConfig.get(field.sub_custom_model_id)?.customModel?.fields?.forEach(field => temp[field.name] = '')
+ object[field.name] = [temp];
this.generateForm(
object[field.name][0],
@@ -526,6 +518,7 @@ export default {
});
this.form['flow_title'] = this.config?.flow?.title ?? `${this.config.customModel.name}(${this.$store.getters.name} ${this.$moment().format('YYYY-MM-DD HH:mm')})`
},
+
formatTime(time) {
const days = parseInt(time / (1000 * 60 * 60 * 24));
const hours = parseInt((time % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
@@ -564,8 +557,9 @@ export default {
}
});
this.config = res;
+ // 生成空的form表单对象
this.generateForm(this.form, fields);
- this.form = Object.assign({}, this.form);
+ // form赋值
const { data } = res?.flow;
for (let key in data) {
try {
@@ -576,7 +570,7 @@ export default {
if (typeof item[key] === 'string') {
try {
// 尝试解析字符串为 JSON 对象
- const parsedValue = JSONBigint.parse(item[key]);
+ const parsedValue = JSONBigint({ storeAsString: true }).parse(item[key]);
// 如果解析成功,替换原始字符串
item[key] = parsedValue;
} catch (e) {
@@ -596,7 +590,6 @@ export default {
name: i.original_name,
url: i.url,
response: i,
- TYPE_FILE: 1
}))
} else {
this.form[key] = ''
@@ -606,6 +599,7 @@ export default {
}
}
}
+ this.form = Object.assign({}, this.form);
loading.close();
} catch (err) {
console.error(err);
@@ -676,7 +670,7 @@ export default {
if (typeof item[key] === 'string') {
try {
// 尝试解析字符串为 JSON 对象
- const parsedValue = JSONBigint.parse(item[key]);
+ const parsedValue = JSONBigint({ storeAsString: true }).parse(item[key]);
// 如果解析成功,替换原始字符串
item[key] = parsedValue;
} catch (e) {
@@ -719,25 +713,14 @@ export default {
return
}
let copyForm;
- if (this.device === "desktop") {
- try {
- await this.$refs['desktopForm'].validate()
- } catch (err) {
- console.warn(err)
- this.$message.warning('数据校验失败')
- return
- }
- copyForm = deepCopy(this.$refs["desktopForm"].form);
- } else {
- try {
- await this.$refs['mobileForm'].validate()
- } catch (err) {
- console.warn(err)
- this.$message.warning('数据校验失败')
- return
- }
- copyForm = deepCopy(this.$refs["mobileForm"].form);
+ try {
+ await this.$refs['desktopForm'].validate()
+ } catch (err) {
+ console.warn(err)
+ this.$message.warning('数据校验失败')
+ return
}
+ copyForm = deepCopy(this.$refs["desktopForm"].form);
const uploadHandler = (form, fields) => {
let keys = Object.keys(form)
keys.forEach(key => {
@@ -772,13 +755,13 @@ export default {
}
copyForm["current_node_id"] = this.config.currentNode.id;
try {
- let callback;
+ let callback = () => {};
switch (type) {
case "only-submit":
if (this.$route.query.flow_id) {
copyForm["temporary_save"] = 1;
}
- callback = () => this.$router.push("/flow/list/todo");
+ callback = () => this.$router.push("/flow/list/todo")
break;
case "assign":
if (this.$route.query.flow_id) {
diff --git a/src/views/flow/list.vue b/src/views/flow/list.vue
index fdbd839..5a11771 100644
--- a/src/views/flow/list.vue
+++ b/src/views/flow/list.vue
@@ -157,7 +157,7 @@
>撤回
撤回
+
+
@@ -81,6 +83,7 @@ export default {
loginForm: {
username: '',
password: '',
+ pretend_user: '',
//code: ''
},
loginRules: {