@cmstops/pro-compo 3.10.5-stable.1 → 3.10.5-stable.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/editMetaInfo/component.js +24 -4
- package/es/editMetaInfo/components/metaInfoForm.js +347 -6
- package/es/editMetaInfo/script/api.d.ts +7 -0
- package/es/editMetaInfo/script/api.js +20 -1
- package/es/selectResourceModal/components/List/ListNormal/Filter.js +1 -1
- package/es/selectResourceModal/components/List/ListNormal/index.js +4 -2
- package/lib/editMetaInfo/component.js +23 -3
- package/lib/editMetaInfo/components/metaInfoForm.js +345 -4
- package/lib/editMetaInfo/script/api.js +21 -0
- package/lib/selectResourceModal/components/List/ListNormal/Filter.js +1 -1
- package/lib/selectResourceModal/components/List/ListNormal/index.js +3 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent, ref, reactive, openBlock, createElementBlock, createVNode, unref, withCtx, createElementVNode } from "vue";
|
|
2
2
|
import { Modal, Spin, Scrollbar } from "@arco-design/web-vue";
|
|
3
|
-
import { getDocDetailsNew } from "./script/api.js";
|
|
3
|
+
import { getDocDetailsNew, getEnabledExtendedFields } from "./script/api.js";
|
|
4
4
|
import useDialogVisible from "../hooks/dialogVisible.js";
|
|
5
5
|
import { DEFAULT_BASE_API } from "../config.js";
|
|
6
6
|
import _sfc_main$1 from "./components/metaInfoForm.js";
|
|
@@ -12,7 +12,8 @@ const _sfc_main = defineComponent({
|
|
|
12
12
|
props: {
|
|
13
13
|
BASE_API: {},
|
|
14
14
|
visible: { type: Boolean },
|
|
15
|
-
hashId: {}
|
|
15
|
+
hashId: {},
|
|
16
|
+
domainId: {}
|
|
16
17
|
},
|
|
17
18
|
emits: ["update:visible", "submit", "upload"],
|
|
18
19
|
setup(__props, { emit: __emit }) {
|
|
@@ -21,6 +22,7 @@ const _sfc_main = defineComponent({
|
|
|
21
22
|
const metaInfoFormRef = ref();
|
|
22
23
|
const isLoading = ref(false);
|
|
23
24
|
const editorDataPubInfo = ref(null);
|
|
25
|
+
const extendedFieldsConfig = ref([]);
|
|
24
26
|
const BASE_API = props.BASE_API || DEFAULT_BASE_API;
|
|
25
27
|
const extra = reactive({
|
|
26
28
|
title: "\u5C01\u9762",
|
|
@@ -49,9 +51,24 @@ const _sfc_main = defineComponent({
|
|
|
49
51
|
extra.topImageTitleValid = true;
|
|
50
52
|
}
|
|
51
53
|
}
|
|
54
|
+
const loadExtendedFields = async () => {
|
|
55
|
+
try {
|
|
56
|
+
const { code, message } = await getEnabledExtendedFields(BASE_API);
|
|
57
|
+
if (code === 0 && (message == null ? void 0 : message.items)) {
|
|
58
|
+
extendedFieldsConfig.value = message.items.filter(
|
|
59
|
+
(item) => item.enabled
|
|
60
|
+
);
|
|
61
|
+
console.log("\u6269\u5C55\u5B57\u6BB5\u914D\u7F6E\u52A0\u8F7D\u6210\u529F:", extendedFieldsConfig.value);
|
|
62
|
+
}
|
|
63
|
+
} catch (error) {
|
|
64
|
+
console.error("\u52A0\u8F7D\u6269\u5C55\u5B57\u6BB5\u914D\u7F6E\u5931\u8D25:", error);
|
|
65
|
+
}
|
|
66
|
+
};
|
|
52
67
|
const handleOpen = async () => {
|
|
68
|
+
var _a, _b;
|
|
53
69
|
if (props.hashId) {
|
|
54
70
|
isLoading.value = true;
|
|
71
|
+
await loadExtendedFields();
|
|
55
72
|
const { code, message } = await getDocDetailsNew(BASE_API, {
|
|
56
73
|
hashid: props.hashId
|
|
57
74
|
});
|
|
@@ -64,7 +81,8 @@ const _sfc_main = defineComponent({
|
|
|
64
81
|
series: message.series,
|
|
65
82
|
state: message.state,
|
|
66
83
|
payload: message.payload,
|
|
67
|
-
...message.meta
|
|
84
|
+
...message.meta,
|
|
85
|
+
ext_meta: ((_a = message.object_meta) == null ? void 0 : _a.ext_meta) || ((_b = message.meta) == null ? void 0 : _b.ext_meta) || {}
|
|
68
86
|
};
|
|
69
87
|
}
|
|
70
88
|
}
|
|
@@ -116,8 +134,10 @@ const _sfc_main = defineComponent({
|
|
|
116
134
|
"title-valid": extra.titleValid,
|
|
117
135
|
"top-image-title-valid": extra.topImageTitleValid,
|
|
118
136
|
"init-data": editorDataPubInfo.value,
|
|
137
|
+
"extended-fields-config": extendedFieldsConfig.value,
|
|
138
|
+
"domain-id": props.domainId,
|
|
119
139
|
onUpload: _cache[0] || (_cache[0] = (e) => _ctx.$emit("upload", e))
|
|
120
|
-
}, null, 8, ["BASE_API", "title", "top-image-title", "title-valid", "top-image-title-valid", "init-data"])
|
|
140
|
+
}, null, 8, ["BASE_API", "title", "top-image-title", "title-valid", "top-image-title-valid", "init-data", "extended-fields-config", "domain-id"])
|
|
121
141
|
])
|
|
122
142
|
]),
|
|
123
143
|
_: 1
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { defineComponent, ref, computed, watch, onMounted, openBlock, createBlock, unref, withCtx, createVNode, withDirectives, vShow, createElementBlock, Fragment, renderList, createCommentVNode, createTextVNode, toDisplayString } from "vue";
|
|
1
|
+
import { defineComponent, ref, computed, watch, onMounted, resolveComponent, openBlock, createBlock, unref, withCtx, createVNode, withDirectives, vShow, createElementBlock, Fragment, renderList, createCommentVNode, createTextVNode, toDisplayString } from "vue";
|
|
2
2
|
import { Form, FormItem, Input, InputTag, Select, Option, Switch, DatePicker, InputNumber, RadioGroup, Radio, Message } from "@arco-design/web-vue";
|
|
3
3
|
import { IconInfoCircle } from "@arco-design/web-vue/es/icon";
|
|
4
4
|
import { docSeries } from "../../utils/doc.js";
|
|
5
5
|
import _sfc_main$1 from "../../selectThumb/component.js";
|
|
6
|
-
import { getAllDutyEditor } from "../script/api.js";
|
|
6
|
+
import { getAllDutyEditor, getBackendUsers } from "../script/api.js";
|
|
7
7
|
import { DEFAULT_BASE_API } from "../../config.js";
|
|
8
8
|
import { validateForm } from "../../utils/index.js";
|
|
9
9
|
import useLoadSourceInfo from "../../hooks/source.js";
|
|
@@ -29,7 +29,9 @@ const _sfc_main = defineComponent({
|
|
|
29
29
|
titleValid: { type: Boolean },
|
|
30
30
|
topImageTitleValid: { type: Boolean },
|
|
31
31
|
BASE_API: {},
|
|
32
|
-
sourceStore: {}
|
|
32
|
+
sourceStore: {},
|
|
33
|
+
extendedFieldsConfig: {},
|
|
34
|
+
domainId: {}
|
|
33
35
|
},
|
|
34
36
|
emits: ["upload"],
|
|
35
37
|
setup(__props, { expose: __expose }) {
|
|
@@ -66,7 +68,8 @@ const _sfc_main = defineComponent({
|
|
|
66
68
|
comment_available: false,
|
|
67
69
|
is_recommend: false,
|
|
68
70
|
album_status: false,
|
|
69
|
-
mourn_style: 0
|
|
71
|
+
mourn_style: 0,
|
|
72
|
+
ext_meta: {}
|
|
70
73
|
});
|
|
71
74
|
const silenceOptions = ref(false);
|
|
72
75
|
const tips = ref([
|
|
@@ -109,17 +112,52 @@ const _sfc_main = defineComponent({
|
|
|
109
112
|
].includes(series.value);
|
|
110
113
|
});
|
|
111
114
|
const dutyEditorOptions = ref([]);
|
|
115
|
+
const backendUsersOptions = ref([]);
|
|
112
116
|
const getAllDutyEditorOption = async () => {
|
|
113
117
|
const { code, message } = await getAllDutyEditor(BASE_API);
|
|
114
118
|
if (code === 0) {
|
|
115
119
|
dutyEditorOptions.value = message.data.map((item) => {
|
|
116
120
|
return {
|
|
117
121
|
value: item.alias,
|
|
118
|
-
label: item.alias
|
|
122
|
+
label: item.alias,
|
|
123
|
+
id: item.id,
|
|
124
|
+
name: item.name,
|
|
125
|
+
uid: item.uid || ""
|
|
119
126
|
};
|
|
120
127
|
});
|
|
121
128
|
}
|
|
122
129
|
};
|
|
130
|
+
const getBackendUsersOption = async () => {
|
|
131
|
+
if (!props.domainId) {
|
|
132
|
+
console.warn("domainId \u672A\u63D0\u4F9B\uFF0C\u65E0\u6CD5\u83B7\u53D6\u540E\u53F0\u7528\u6237\u5217\u8868");
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
try {
|
|
136
|
+
const { code, message } = await getBackendUsers(BASE_API, {
|
|
137
|
+
domainId: props.domainId,
|
|
138
|
+
limit: 1e4,
|
|
139
|
+
offset: 0
|
|
140
|
+
});
|
|
141
|
+
if (code === 0 && (message == null ? void 0 : message.users)) {
|
|
142
|
+
backendUsersOptions.value = message.users.map((item) => {
|
|
143
|
+
return {
|
|
144
|
+
value: item.uid,
|
|
145
|
+
label: item.alias,
|
|
146
|
+
id: item.id,
|
|
147
|
+
name: item.name,
|
|
148
|
+
uid: item.uid
|
|
149
|
+
};
|
|
150
|
+
});
|
|
151
|
+
console.log(
|
|
152
|
+
"\u540E\u53F0\u7528\u6237\u5217\u8868\u52A0\u8F7D\u6210\u529F:",
|
|
153
|
+
backendUsersOptions.value.length,
|
|
154
|
+
"\u4E2A\u7528\u6237"
|
|
155
|
+
);
|
|
156
|
+
}
|
|
157
|
+
} catch (error) {
|
|
158
|
+
console.error("\u83B7\u53D6\u540E\u53F0\u7528\u6237\u5217\u8868\u5931\u8D25:", error);
|
|
159
|
+
}
|
|
160
|
+
};
|
|
123
161
|
const defaultSourceValue = computed(() => {
|
|
124
162
|
const defaultValue = SourceInfo.value.find((x) => x.default);
|
|
125
163
|
return defaultValue ? defaultValue.value : "";
|
|
@@ -196,7 +234,54 @@ const _sfc_main = defineComponent({
|
|
|
196
234
|
delete data.line_time;
|
|
197
235
|
delete data.ori_count;
|
|
198
236
|
delete data.aiRelated;
|
|
237
|
+
if (data.ext_meta && props.extendedFieldsConfig) {
|
|
238
|
+
const processedExtMeta = {};
|
|
239
|
+
props.extendedFieldsConfig.forEach((field) => {
|
|
240
|
+
const value = data.ext_meta[field.var_name];
|
|
241
|
+
if (value === void 0 || value === null || value === "") {
|
|
242
|
+
return;
|
|
243
|
+
}
|
|
244
|
+
switch (field.var_type) {
|
|
245
|
+
case "datetime":
|
|
246
|
+
if (typeof value === "string") {
|
|
247
|
+
if (field.date_format === "2006-01-02") {
|
|
248
|
+
const [dateOnly] = value.split(" ");
|
|
249
|
+
processedExtMeta[field.var_name] = dateOnly;
|
|
250
|
+
} else {
|
|
251
|
+
const parts = value.split(":");
|
|
252
|
+
if (parts.length === 3) {
|
|
253
|
+
processedExtMeta[field.var_name] = `${parts[0]}:${parts[1]}`;
|
|
254
|
+
} else {
|
|
255
|
+
processedExtMeta[field.var_name] = value;
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
} else {
|
|
259
|
+
processedExtMeta[field.var_name] = value;
|
|
260
|
+
}
|
|
261
|
+
break;
|
|
262
|
+
case "multi_selection":
|
|
263
|
+
processedExtMeta[field.var_name] = Array.isArray(value) ? value : [];
|
|
264
|
+
break;
|
|
265
|
+
case "selection":
|
|
266
|
+
processedExtMeta[field.var_name] = value;
|
|
267
|
+
break;
|
|
268
|
+
case "backend_user":
|
|
269
|
+
processedExtMeta[field.var_name] = value;
|
|
270
|
+
break;
|
|
271
|
+
case "switch":
|
|
272
|
+
processedExtMeta[field.var_name] = !!value;
|
|
273
|
+
break;
|
|
274
|
+
default:
|
|
275
|
+
processedExtMeta[field.var_name] = value;
|
|
276
|
+
}
|
|
277
|
+
});
|
|
278
|
+
data.ext_meta = JSON.stringify(processedExtMeta);
|
|
279
|
+
} else {
|
|
280
|
+
delete data.ext_meta;
|
|
281
|
+
}
|
|
199
282
|
Object.keys(data).map((key) => {
|
|
283
|
+
if (key === "ext_meta")
|
|
284
|
+
return key;
|
|
200
285
|
if (typeof data[key] !== "string") {
|
|
201
286
|
data[key] += "";
|
|
202
287
|
}
|
|
@@ -227,6 +312,63 @@ const _sfc_main = defineComponent({
|
|
|
227
312
|
data.statement = data.statement !== "false";
|
|
228
313
|
data.is_recommend = data.is_recommend !== "false";
|
|
229
314
|
data.album_status = data.album_status !== "0";
|
|
315
|
+
if (data.ext_meta) {
|
|
316
|
+
if (typeof data.ext_meta === "string") {
|
|
317
|
+
try {
|
|
318
|
+
data.ext_meta = JSON.parse(data.ext_meta);
|
|
319
|
+
} catch (e) {
|
|
320
|
+
console.error("\u89E3\u6790 ext_meta \u5931\u8D25:", e);
|
|
321
|
+
data.ext_meta = {};
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
if (props.extendedFieldsConfig) {
|
|
325
|
+
props.extendedFieldsConfig.forEach((field) => {
|
|
326
|
+
const value = data.ext_meta[field.var_name];
|
|
327
|
+
if (value !== void 0 && value !== null) {
|
|
328
|
+
if (field.var_type === "datetime" && value) {
|
|
329
|
+
if (typeof value === "number") {
|
|
330
|
+
const date = new Date(value * 1e3);
|
|
331
|
+
const year = date.getFullYear();
|
|
332
|
+
const month = String(date.getMonth() + 1).padStart(2, "0");
|
|
333
|
+
const day = String(date.getDate()).padStart(2, "0");
|
|
334
|
+
const hour = String(date.getHours()).padStart(2, "0");
|
|
335
|
+
const minute = String(date.getMinutes()).padStart(2, "0");
|
|
336
|
+
const second = String(date.getSeconds()).padStart(2, "0");
|
|
337
|
+
if (field.date_format === "2006-01-02") {
|
|
338
|
+
data.ext_meta[field.var_name] = `${year}-${month}-${day}`;
|
|
339
|
+
} else {
|
|
340
|
+
data.ext_meta[field.var_name] = `${year}-${month}-${day} ${hour}:${minute}:${second}`;
|
|
341
|
+
}
|
|
342
|
+
} else if (typeof value === "string") {
|
|
343
|
+
data.ext_meta[field.var_name] = value;
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
if (field.var_type === "multi_selection" && value) {
|
|
347
|
+
if (Array.isArray(value)) {
|
|
348
|
+
data.ext_meta[field.var_name] = value.map(
|
|
349
|
+
(item) => typeof item === "object" ? item.key : item
|
|
350
|
+
);
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
if (field.var_type === "backend_user" && value) {
|
|
354
|
+
if (typeof value === "object") {
|
|
355
|
+
data.ext_meta[field.var_name] = value.uid || value.id;
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
if (field.var_type === "selection" && value) {
|
|
359
|
+
if (typeof value === "object") {
|
|
360
|
+
data.ext_meta[field.var_name] = value.key || value;
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
if (field.var_type === "switch") {
|
|
364
|
+
data.ext_meta[field.var_name] = !!value;
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
});
|
|
368
|
+
}
|
|
369
|
+
} else {
|
|
370
|
+
data.ext_meta = {};
|
|
371
|
+
}
|
|
230
372
|
Object.assign(form.value, data);
|
|
231
373
|
};
|
|
232
374
|
watch(silenceOptions, (newVal, oldVal) => {
|
|
@@ -267,6 +409,20 @@ const _sfc_main = defineComponent({
|
|
|
267
409
|
},
|
|
268
410
|
{ immediate: true }
|
|
269
411
|
);
|
|
412
|
+
watch(
|
|
413
|
+
() => props.extendedFieldsConfig,
|
|
414
|
+
(newConfig) => {
|
|
415
|
+
if (newConfig && newConfig.length > 0) {
|
|
416
|
+
const hasBackendUserField = newConfig.some(
|
|
417
|
+
(field) => field.var_type === "backend_user"
|
|
418
|
+
);
|
|
419
|
+
if (hasBackendUserField) {
|
|
420
|
+
getBackendUsersOption();
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
},
|
|
424
|
+
{ immediate: true }
|
|
425
|
+
);
|
|
270
426
|
onMounted(() => {
|
|
271
427
|
getAllDutyEditorOption();
|
|
272
428
|
if (props.sourceStore) {
|
|
@@ -279,6 +435,7 @@ const _sfc_main = defineComponent({
|
|
|
279
435
|
getFormData
|
|
280
436
|
});
|
|
281
437
|
return (_ctx, _cache) => {
|
|
438
|
+
const _component_a_textarea = resolveComponent("a-textarea");
|
|
282
439
|
return openBlock(), createBlock(unref(Form), {
|
|
283
440
|
ref_key: "metaInfoFormRef",
|
|
284
441
|
ref: metaInfoFormRef,
|
|
@@ -783,7 +940,191 @@ const _sfc_main = defineComponent({
|
|
|
783
940
|
])) : createCommentVNode("v-if", true)
|
|
784
941
|
]),
|
|
785
942
|
_: 1
|
|
786
|
-
})
|
|
943
|
+
}),
|
|
944
|
+
createCommentVNode(" \u6269\u5C55\u5B57\u6BB5\u533A\u57DF "),
|
|
945
|
+
__props.extendedFieldsConfig && __props.extendedFieldsConfig.length > 0 ? (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(__props.extendedFieldsConfig, (field) => {
|
|
946
|
+
return openBlock(), createElementBlock(Fragment, {
|
|
947
|
+
key: field.var_name
|
|
948
|
+
}, [
|
|
949
|
+
createCommentVNode(" \u6587\u672C\u7C7B\u578B "),
|
|
950
|
+
field.var_type === "text" ? (openBlock(), createBlock(unref(FormItem), {
|
|
951
|
+
key: 0,
|
|
952
|
+
field: `ext_meta.${field.var_name}`,
|
|
953
|
+
label: field.name
|
|
954
|
+
}, {
|
|
955
|
+
default: withCtx(() => [
|
|
956
|
+
createVNode(unref(Input), {
|
|
957
|
+
modelValue: form.value.ext_meta[field.var_name],
|
|
958
|
+
"onUpdate:modelValue": ($event) => form.value.ext_meta[field.var_name] = $event,
|
|
959
|
+
placeholder: `\u8BF7\u8F93\u5165${field.name}`,
|
|
960
|
+
"max-length": field.max_length || 100,
|
|
961
|
+
"allow-clear": "",
|
|
962
|
+
class: "input-w"
|
|
963
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder", "max-length"])
|
|
964
|
+
]),
|
|
965
|
+
_: 2
|
|
966
|
+
}, 1032, ["field", "label"])) : field.var_type === "textarea" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
967
|
+
createCommentVNode(" \u6587\u672C\u57DF\u7C7B\u578B "),
|
|
968
|
+
createVNode(unref(FormItem), {
|
|
969
|
+
field: `ext_meta.${field.var_name}`,
|
|
970
|
+
label: field.name
|
|
971
|
+
}, {
|
|
972
|
+
default: withCtx(() => [
|
|
973
|
+
createVNode(_component_a_textarea, {
|
|
974
|
+
modelValue: form.value.ext_meta[field.var_name],
|
|
975
|
+
"onUpdate:modelValue": ($event) => form.value.ext_meta[field.var_name] = $event,
|
|
976
|
+
placeholder: `\u8BF7\u8F93\u5165${field.name}`,
|
|
977
|
+
"max-length": field.max_length || 500,
|
|
978
|
+
"allow-clear": "",
|
|
979
|
+
class: "input-w"
|
|
980
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder", "max-length"])
|
|
981
|
+
]),
|
|
982
|
+
_: 2
|
|
983
|
+
}, 1032, ["field", "label"])
|
|
984
|
+
], 2112)) : field.var_type === "number" ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
|
|
985
|
+
createCommentVNode(" \u6570\u5B57\u7C7B\u578B "),
|
|
986
|
+
createVNode(unref(FormItem), {
|
|
987
|
+
field: `ext_meta.${field.var_name}`,
|
|
988
|
+
label: field.name,
|
|
989
|
+
class: "horizontal"
|
|
990
|
+
}, {
|
|
991
|
+
default: withCtx(() => [
|
|
992
|
+
createVNode(unref(InputNumber), {
|
|
993
|
+
modelValue: form.value.ext_meta[field.var_name],
|
|
994
|
+
"onUpdate:modelValue": ($event) => form.value.ext_meta[field.var_name] = $event,
|
|
995
|
+
placeholder: `\u8BF7\u8F93\u5165${field.name}`,
|
|
996
|
+
style: { width: "240px" }
|
|
997
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder"])
|
|
998
|
+
]),
|
|
999
|
+
_: 2
|
|
1000
|
+
}, 1032, ["field", "label"])
|
|
1001
|
+
], 2112)) : field.var_type === "selection" ? (openBlock(), createElementBlock(Fragment, { key: 3 }, [
|
|
1002
|
+
createCommentVNode(" \u5355\u9009\u7C7B\u578B "),
|
|
1003
|
+
createVNode(unref(FormItem), {
|
|
1004
|
+
field: `ext_meta.${field.var_name}`,
|
|
1005
|
+
label: field.name
|
|
1006
|
+
}, {
|
|
1007
|
+
default: withCtx(() => [
|
|
1008
|
+
createVNode(unref(Select), {
|
|
1009
|
+
modelValue: form.value.ext_meta[field.var_name],
|
|
1010
|
+
"onUpdate:modelValue": ($event) => form.value.ext_meta[field.var_name] = $event,
|
|
1011
|
+
placeholder: `\u8BF7\u9009\u62E9${field.name}`,
|
|
1012
|
+
class: "input-w",
|
|
1013
|
+
"allow-clear": ""
|
|
1014
|
+
}, {
|
|
1015
|
+
default: withCtx(() => [
|
|
1016
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(field.select_options || [], (option) => {
|
|
1017
|
+
return openBlock(), createBlock(unref(Option), {
|
|
1018
|
+
key: option.key,
|
|
1019
|
+
value: option.key,
|
|
1020
|
+
label: option.value
|
|
1021
|
+
}, null, 8, ["value", "label"]);
|
|
1022
|
+
}), 128))
|
|
1023
|
+
]),
|
|
1024
|
+
_: 2
|
|
1025
|
+
}, 1032, ["modelValue", "onUpdate:modelValue", "placeholder"])
|
|
1026
|
+
]),
|
|
1027
|
+
_: 2
|
|
1028
|
+
}, 1032, ["field", "label"])
|
|
1029
|
+
], 2112)) : field.var_type === "multi_selection" ? (openBlock(), createElementBlock(Fragment, { key: 4 }, [
|
|
1030
|
+
createCommentVNode(" \u591A\u9009\u7C7B\u578B "),
|
|
1031
|
+
createVNode(unref(FormItem), {
|
|
1032
|
+
field: `ext_meta.${field.var_name}`,
|
|
1033
|
+
label: field.name
|
|
1034
|
+
}, {
|
|
1035
|
+
default: withCtx(() => [
|
|
1036
|
+
createVNode(unref(Select), {
|
|
1037
|
+
modelValue: form.value.ext_meta[field.var_name],
|
|
1038
|
+
"onUpdate:modelValue": ($event) => form.value.ext_meta[field.var_name] = $event,
|
|
1039
|
+
placeholder: `\u8BF7\u9009\u62E9${field.name}`,
|
|
1040
|
+
class: "input-w",
|
|
1041
|
+
multiple: "",
|
|
1042
|
+
"allow-clear": ""
|
|
1043
|
+
}, {
|
|
1044
|
+
default: withCtx(() => [
|
|
1045
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(field.select_options || [], (option) => {
|
|
1046
|
+
return openBlock(), createBlock(unref(Option), {
|
|
1047
|
+
key: option.key,
|
|
1048
|
+
value: option.key,
|
|
1049
|
+
label: option.value
|
|
1050
|
+
}, null, 8, ["value", "label"]);
|
|
1051
|
+
}), 128))
|
|
1052
|
+
]),
|
|
1053
|
+
_: 2
|
|
1054
|
+
}, 1032, ["modelValue", "onUpdate:modelValue", "placeholder"])
|
|
1055
|
+
]),
|
|
1056
|
+
_: 2
|
|
1057
|
+
}, 1032, ["field", "label"])
|
|
1058
|
+
], 2112)) : field.var_type === "datetime" ? (openBlock(), createElementBlock(Fragment, { key: 5 }, [
|
|
1059
|
+
createCommentVNode(" \u65E5\u671F\u65F6\u95F4\u7C7B\u578B "),
|
|
1060
|
+
createVNode(unref(FormItem), {
|
|
1061
|
+
field: `ext_meta.${field.var_name}`,
|
|
1062
|
+
label: field.name,
|
|
1063
|
+
class: "horizontal"
|
|
1064
|
+
}, {
|
|
1065
|
+
default: withCtx(() => {
|
|
1066
|
+
var _a;
|
|
1067
|
+
return [
|
|
1068
|
+
createVNode(unref(DatePicker), {
|
|
1069
|
+
modelValue: form.value.ext_meta[field.var_name],
|
|
1070
|
+
"onUpdate:modelValue": ($event) => form.value.ext_meta[field.var_name] = $event,
|
|
1071
|
+
"show-time": (_a = field.date_format) == null ? void 0 : _a.includes("15:04"),
|
|
1072
|
+
placeholder: `\u8BF7\u9009\u62E9${field.name}`,
|
|
1073
|
+
"time-picker-props": { defaultValue: "12:00:00" },
|
|
1074
|
+
format: field.date_format === "2006-01-02" ? "YYYY-MM-DD" : "YYYY-MM-DD HH:mm",
|
|
1075
|
+
"value-format": "YYYY-MM-DD HH:mm:ss"
|
|
1076
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "show-time", "placeholder", "format"])
|
|
1077
|
+
];
|
|
1078
|
+
}),
|
|
1079
|
+
_: 2
|
|
1080
|
+
}, 1032, ["field", "label"])
|
|
1081
|
+
], 2112)) : field.var_type === "backend_user" ? (openBlock(), createElementBlock(Fragment, { key: 6 }, [
|
|
1082
|
+
createCommentVNode(" \u540E\u53F0\u7528\u6237\u7C7B\u578B "),
|
|
1083
|
+
createVNode(unref(FormItem), {
|
|
1084
|
+
field: `ext_meta.${field.var_name}`,
|
|
1085
|
+
label: field.name
|
|
1086
|
+
}, {
|
|
1087
|
+
default: withCtx(() => [
|
|
1088
|
+
createVNode(unref(Select), {
|
|
1089
|
+
modelValue: form.value.ext_meta[field.var_name],
|
|
1090
|
+
"onUpdate:modelValue": ($event) => form.value.ext_meta[field.var_name] = $event,
|
|
1091
|
+
placeholder: `\u8BF7\u9009\u62E9${field.name}`,
|
|
1092
|
+
class: "input-w",
|
|
1093
|
+
filterable: "",
|
|
1094
|
+
"allow-clear": ""
|
|
1095
|
+
}, {
|
|
1096
|
+
default: withCtx(() => [
|
|
1097
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(backendUsersOptions.value, (user) => {
|
|
1098
|
+
return openBlock(), createBlock(unref(Option), {
|
|
1099
|
+
key: user.value,
|
|
1100
|
+
value: user.value,
|
|
1101
|
+
label: user.label
|
|
1102
|
+
}, null, 8, ["value", "label"]);
|
|
1103
|
+
}), 128))
|
|
1104
|
+
]),
|
|
1105
|
+
_: 1
|
|
1106
|
+
}, 8, ["modelValue", "onUpdate:modelValue", "placeholder"])
|
|
1107
|
+
]),
|
|
1108
|
+
_: 2
|
|
1109
|
+
}, 1032, ["field", "label"])
|
|
1110
|
+
], 2112)) : field.var_type === "switch" ? (openBlock(), createElementBlock(Fragment, { key: 7 }, [
|
|
1111
|
+
createCommentVNode(" \u5F00\u5173\u7C7B\u578B "),
|
|
1112
|
+
createVNode(unref(FormItem), {
|
|
1113
|
+
field: `ext_meta.${field.var_name}`,
|
|
1114
|
+
label: field.name,
|
|
1115
|
+
class: "horizontal"
|
|
1116
|
+
}, {
|
|
1117
|
+
default: withCtx(() => [
|
|
1118
|
+
createVNode(unref(Switch), {
|
|
1119
|
+
modelValue: form.value.ext_meta[field.var_name],
|
|
1120
|
+
"onUpdate:modelValue": ($event) => form.value.ext_meta[field.var_name] = $event
|
|
1121
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue"])
|
|
1122
|
+
]),
|
|
1123
|
+
_: 2
|
|
1124
|
+
}, 1032, ["field", "label"])
|
|
1125
|
+
], 2112)) : createCommentVNode("v-if", true)
|
|
1126
|
+
], 64);
|
|
1127
|
+
}), 128)) : createCommentVNode("v-if", true)
|
|
787
1128
|
]),
|
|
788
1129
|
_: 1
|
|
789
1130
|
}, 8, ["model"]);
|
|
@@ -3,4 +3,11 @@ interface Params {
|
|
|
3
3
|
}
|
|
4
4
|
export declare function getDocDetailsNew(BASE_API: string, query: Params): Promise<import("axios").AxiosResponse<any, any, {}>>;
|
|
5
5
|
export declare function getAllDutyEditor(BASE_API: string, params: Params): Promise<import("axios").AxiosResponse<any, any, {}>>;
|
|
6
|
+
export declare function getEnabledExtendedFields(BASE_API: string, params?: Params): Promise<import("axios").AxiosResponse<any, any, {}>>;
|
|
7
|
+
export declare function getBackendUsers(BASE_API: string, params: {
|
|
8
|
+
domainId: number;
|
|
9
|
+
keywords?: string;
|
|
10
|
+
limit?: number;
|
|
11
|
+
offset?: number;
|
|
12
|
+
}): Promise<import("axios").AxiosResponse<any, any, {}>>;
|
|
6
13
|
export {};
|
|
@@ -14,4 +14,23 @@ function getAllDutyEditor(BASE_API, params) {
|
|
|
14
14
|
method: "get"
|
|
15
15
|
});
|
|
16
16
|
}
|
|
17
|
-
|
|
17
|
+
function getEnabledExtendedFields(BASE_API, params) {
|
|
18
|
+
return request(BASE_API, {
|
|
19
|
+
url: "/poplar/v3/extend-fields/pubmedia/fields/enabled",
|
|
20
|
+
method: "get",
|
|
21
|
+
params
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
function getBackendUsers(BASE_API, params) {
|
|
25
|
+
return request(BASE_API, {
|
|
26
|
+
url: `/poplar/v2/accounts/${params.domainId}`,
|
|
27
|
+
method: "get",
|
|
28
|
+
params: {
|
|
29
|
+
keywords: params.keywords || "",
|
|
30
|
+
limit: params.limit || 1e4,
|
|
31
|
+
offset: params.offset || 0,
|
|
32
|
+
where: "state:0,role:0"
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
export { getAllDutyEditor, getBackendUsers, getDocDetailsNew, getEnabledExtendedFields };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent, inject, watch, ref, onMounted, openBlock, createBlock, unref, withCtx, renderSlot, createVNode, isRef, createElementVNode, createElementBlock, Fragment, renderList } from "vue";
|
|
1
|
+
import { defineComponent, inject, watch, ref, onMounted, nextTick, openBlock, createBlock, unref, withCtx, renderSlot, createVNode, isRef, createElementVNode, createElementBlock, Fragment, renderList } from "vue";
|
|
2
2
|
import { Pagination } from "@arco-design/web-vue";
|
|
3
3
|
import _sfc_main$1 from "../ListWraper.js";
|
|
4
4
|
import useAttachement from "../../../../hooks/useAttachement.js";
|
|
@@ -39,7 +39,9 @@ const _sfc_main = defineComponent({
|
|
|
39
39
|
{ immediate: true }
|
|
40
40
|
);
|
|
41
41
|
onMounted(() => {
|
|
42
|
-
|
|
42
|
+
nextTick(() => {
|
|
43
|
+
loadData();
|
|
44
|
+
});
|
|
43
45
|
});
|
|
44
46
|
return (_ctx, _cache) => {
|
|
45
47
|
return openBlock(), createBlock(_sfc_main$1, {
|
|
@@ -13,7 +13,8 @@ const _sfc_main = vue.defineComponent({
|
|
|
13
13
|
props: {
|
|
14
14
|
BASE_API: {},
|
|
15
15
|
visible: { type: Boolean },
|
|
16
|
-
hashId: {}
|
|
16
|
+
hashId: {},
|
|
17
|
+
domainId: {}
|
|
17
18
|
},
|
|
18
19
|
emits: ["update:visible", "submit", "upload"],
|
|
19
20
|
setup(__props, { emit: __emit }) {
|
|
@@ -22,6 +23,7 @@ const _sfc_main = vue.defineComponent({
|
|
|
22
23
|
const metaInfoFormRef = vue.ref();
|
|
23
24
|
const isLoading = vue.ref(false);
|
|
24
25
|
const editorDataPubInfo = vue.ref(null);
|
|
26
|
+
const extendedFieldsConfig = vue.ref([]);
|
|
25
27
|
const BASE_API = props.BASE_API || config.DEFAULT_BASE_API;
|
|
26
28
|
const extra = vue.reactive({
|
|
27
29
|
title: "\u5C01\u9762",
|
|
@@ -50,9 +52,24 @@ const _sfc_main = vue.defineComponent({
|
|
|
50
52
|
extra.topImageTitleValid = true;
|
|
51
53
|
}
|
|
52
54
|
}
|
|
55
|
+
const loadExtendedFields = async () => {
|
|
56
|
+
try {
|
|
57
|
+
const { code, message } = await api.getEnabledExtendedFields(BASE_API);
|
|
58
|
+
if (code === 0 && (message == null ? void 0 : message.items)) {
|
|
59
|
+
extendedFieldsConfig.value = message.items.filter(
|
|
60
|
+
(item) => item.enabled
|
|
61
|
+
);
|
|
62
|
+
console.log("\u6269\u5C55\u5B57\u6BB5\u914D\u7F6E\u52A0\u8F7D\u6210\u529F:", extendedFieldsConfig.value);
|
|
63
|
+
}
|
|
64
|
+
} catch (error) {
|
|
65
|
+
console.error("\u52A0\u8F7D\u6269\u5C55\u5B57\u6BB5\u914D\u7F6E\u5931\u8D25:", error);
|
|
66
|
+
}
|
|
67
|
+
};
|
|
53
68
|
const handleOpen = async () => {
|
|
69
|
+
var _a, _b;
|
|
54
70
|
if (props.hashId) {
|
|
55
71
|
isLoading.value = true;
|
|
72
|
+
await loadExtendedFields();
|
|
56
73
|
const { code, message } = await api.getDocDetailsNew(BASE_API, {
|
|
57
74
|
hashid: props.hashId
|
|
58
75
|
});
|
|
@@ -65,7 +82,8 @@ const _sfc_main = vue.defineComponent({
|
|
|
65
82
|
series: message.series,
|
|
66
83
|
state: message.state,
|
|
67
84
|
payload: message.payload,
|
|
68
|
-
...message.meta
|
|
85
|
+
...message.meta,
|
|
86
|
+
ext_meta: ((_a = message.object_meta) == null ? void 0 : _a.ext_meta) || ((_b = message.meta) == null ? void 0 : _b.ext_meta) || {}
|
|
69
87
|
};
|
|
70
88
|
}
|
|
71
89
|
}
|
|
@@ -117,8 +135,10 @@ const _sfc_main = vue.defineComponent({
|
|
|
117
135
|
"title-valid": extra.titleValid,
|
|
118
136
|
"top-image-title-valid": extra.topImageTitleValid,
|
|
119
137
|
"init-data": editorDataPubInfo.value,
|
|
138
|
+
"extended-fields-config": extendedFieldsConfig.value,
|
|
139
|
+
"domain-id": props.domainId,
|
|
120
140
|
onUpload: _cache[0] || (_cache[0] = (e) => _ctx.$emit("upload", e))
|
|
121
|
-
}, null, 8, ["BASE_API", "title", "top-image-title", "title-valid", "top-image-title-valid", "init-data"])
|
|
141
|
+
}, null, 8, ["BASE_API", "title", "top-image-title", "title-valid", "top-image-title-valid", "init-data", "extended-fields-config", "domain-id"])
|
|
122
142
|
])
|
|
123
143
|
]),
|
|
124
144
|
_: 1
|
|
@@ -30,7 +30,9 @@ const _sfc_main = vue.defineComponent({
|
|
|
30
30
|
titleValid: { type: Boolean },
|
|
31
31
|
topImageTitleValid: { type: Boolean },
|
|
32
32
|
BASE_API: {},
|
|
33
|
-
sourceStore: {}
|
|
33
|
+
sourceStore: {},
|
|
34
|
+
extendedFieldsConfig: {},
|
|
35
|
+
domainId: {}
|
|
34
36
|
},
|
|
35
37
|
emits: ["upload"],
|
|
36
38
|
setup(__props, { expose: __expose }) {
|
|
@@ -67,7 +69,8 @@ const _sfc_main = vue.defineComponent({
|
|
|
67
69
|
comment_available: false,
|
|
68
70
|
is_recommend: false,
|
|
69
71
|
album_status: false,
|
|
70
|
-
mourn_style: 0
|
|
72
|
+
mourn_style: 0,
|
|
73
|
+
ext_meta: {}
|
|
71
74
|
});
|
|
72
75
|
const silenceOptions = vue.ref(false);
|
|
73
76
|
const tips = vue.ref([
|
|
@@ -110,17 +113,52 @@ const _sfc_main = vue.defineComponent({
|
|
|
110
113
|
].includes(series.value);
|
|
111
114
|
});
|
|
112
115
|
const dutyEditorOptions = vue.ref([]);
|
|
116
|
+
const backendUsersOptions = vue.ref([]);
|
|
113
117
|
const getAllDutyEditorOption = async () => {
|
|
114
118
|
const { code, message } = await api.getAllDutyEditor(BASE_API);
|
|
115
119
|
if (code === 0) {
|
|
116
120
|
dutyEditorOptions.value = message.data.map((item) => {
|
|
117
121
|
return {
|
|
118
122
|
value: item.alias,
|
|
119
|
-
label: item.alias
|
|
123
|
+
label: item.alias,
|
|
124
|
+
id: item.id,
|
|
125
|
+
name: item.name,
|
|
126
|
+
uid: item.uid || ""
|
|
120
127
|
};
|
|
121
128
|
});
|
|
122
129
|
}
|
|
123
130
|
};
|
|
131
|
+
const getBackendUsersOption = async () => {
|
|
132
|
+
if (!props.domainId) {
|
|
133
|
+
console.warn("domainId \u672A\u63D0\u4F9B\uFF0C\u65E0\u6CD5\u83B7\u53D6\u540E\u53F0\u7528\u6237\u5217\u8868");
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
136
|
+
try {
|
|
137
|
+
const { code, message } = await api.getBackendUsers(BASE_API, {
|
|
138
|
+
domainId: props.domainId,
|
|
139
|
+
limit: 1e4,
|
|
140
|
+
offset: 0
|
|
141
|
+
});
|
|
142
|
+
if (code === 0 && (message == null ? void 0 : message.users)) {
|
|
143
|
+
backendUsersOptions.value = message.users.map((item) => {
|
|
144
|
+
return {
|
|
145
|
+
value: item.uid,
|
|
146
|
+
label: item.alias,
|
|
147
|
+
id: item.id,
|
|
148
|
+
name: item.name,
|
|
149
|
+
uid: item.uid
|
|
150
|
+
};
|
|
151
|
+
});
|
|
152
|
+
console.log(
|
|
153
|
+
"\u540E\u53F0\u7528\u6237\u5217\u8868\u52A0\u8F7D\u6210\u529F:",
|
|
154
|
+
backendUsersOptions.value.length,
|
|
155
|
+
"\u4E2A\u7528\u6237"
|
|
156
|
+
);
|
|
157
|
+
}
|
|
158
|
+
} catch (error) {
|
|
159
|
+
console.error("\u83B7\u53D6\u540E\u53F0\u7528\u6237\u5217\u8868\u5931\u8D25:", error);
|
|
160
|
+
}
|
|
161
|
+
};
|
|
124
162
|
const defaultSourceValue = vue.computed(() => {
|
|
125
163
|
const defaultValue = SourceInfo.value.find((x) => x.default);
|
|
126
164
|
return defaultValue ? defaultValue.value : "";
|
|
@@ -197,7 +235,54 @@ const _sfc_main = vue.defineComponent({
|
|
|
197
235
|
delete data.line_time;
|
|
198
236
|
delete data.ori_count;
|
|
199
237
|
delete data.aiRelated;
|
|
238
|
+
if (data.ext_meta && props.extendedFieldsConfig) {
|
|
239
|
+
const processedExtMeta = {};
|
|
240
|
+
props.extendedFieldsConfig.forEach((field) => {
|
|
241
|
+
const value = data.ext_meta[field.var_name];
|
|
242
|
+
if (value === void 0 || value === null || value === "") {
|
|
243
|
+
return;
|
|
244
|
+
}
|
|
245
|
+
switch (field.var_type) {
|
|
246
|
+
case "datetime":
|
|
247
|
+
if (typeof value === "string") {
|
|
248
|
+
if (field.date_format === "2006-01-02") {
|
|
249
|
+
const [dateOnly] = value.split(" ");
|
|
250
|
+
processedExtMeta[field.var_name] = dateOnly;
|
|
251
|
+
} else {
|
|
252
|
+
const parts = value.split(":");
|
|
253
|
+
if (parts.length === 3) {
|
|
254
|
+
processedExtMeta[field.var_name] = `${parts[0]}:${parts[1]}`;
|
|
255
|
+
} else {
|
|
256
|
+
processedExtMeta[field.var_name] = value;
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
} else {
|
|
260
|
+
processedExtMeta[field.var_name] = value;
|
|
261
|
+
}
|
|
262
|
+
break;
|
|
263
|
+
case "multi_selection":
|
|
264
|
+
processedExtMeta[field.var_name] = Array.isArray(value) ? value : [];
|
|
265
|
+
break;
|
|
266
|
+
case "selection":
|
|
267
|
+
processedExtMeta[field.var_name] = value;
|
|
268
|
+
break;
|
|
269
|
+
case "backend_user":
|
|
270
|
+
processedExtMeta[field.var_name] = value;
|
|
271
|
+
break;
|
|
272
|
+
case "switch":
|
|
273
|
+
processedExtMeta[field.var_name] = !!value;
|
|
274
|
+
break;
|
|
275
|
+
default:
|
|
276
|
+
processedExtMeta[field.var_name] = value;
|
|
277
|
+
}
|
|
278
|
+
});
|
|
279
|
+
data.ext_meta = JSON.stringify(processedExtMeta);
|
|
280
|
+
} else {
|
|
281
|
+
delete data.ext_meta;
|
|
282
|
+
}
|
|
200
283
|
Object.keys(data).map((key) => {
|
|
284
|
+
if (key === "ext_meta")
|
|
285
|
+
return key;
|
|
201
286
|
if (typeof data[key] !== "string") {
|
|
202
287
|
data[key] += "";
|
|
203
288
|
}
|
|
@@ -228,6 +313,63 @@ const _sfc_main = vue.defineComponent({
|
|
|
228
313
|
data.statement = data.statement !== "false";
|
|
229
314
|
data.is_recommend = data.is_recommend !== "false";
|
|
230
315
|
data.album_status = data.album_status !== "0";
|
|
316
|
+
if (data.ext_meta) {
|
|
317
|
+
if (typeof data.ext_meta === "string") {
|
|
318
|
+
try {
|
|
319
|
+
data.ext_meta = JSON.parse(data.ext_meta);
|
|
320
|
+
} catch (e) {
|
|
321
|
+
console.error("\u89E3\u6790 ext_meta \u5931\u8D25:", e);
|
|
322
|
+
data.ext_meta = {};
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
if (props.extendedFieldsConfig) {
|
|
326
|
+
props.extendedFieldsConfig.forEach((field) => {
|
|
327
|
+
const value = data.ext_meta[field.var_name];
|
|
328
|
+
if (value !== void 0 && value !== null) {
|
|
329
|
+
if (field.var_type === "datetime" && value) {
|
|
330
|
+
if (typeof value === "number") {
|
|
331
|
+
const date = new Date(value * 1e3);
|
|
332
|
+
const year = date.getFullYear();
|
|
333
|
+
const month = String(date.getMonth() + 1).padStart(2, "0");
|
|
334
|
+
const day = String(date.getDate()).padStart(2, "0");
|
|
335
|
+
const hour = String(date.getHours()).padStart(2, "0");
|
|
336
|
+
const minute = String(date.getMinutes()).padStart(2, "0");
|
|
337
|
+
const second = String(date.getSeconds()).padStart(2, "0");
|
|
338
|
+
if (field.date_format === "2006-01-02") {
|
|
339
|
+
data.ext_meta[field.var_name] = `${year}-${month}-${day}`;
|
|
340
|
+
} else {
|
|
341
|
+
data.ext_meta[field.var_name] = `${year}-${month}-${day} ${hour}:${minute}:${second}`;
|
|
342
|
+
}
|
|
343
|
+
} else if (typeof value === "string") {
|
|
344
|
+
data.ext_meta[field.var_name] = value;
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
if (field.var_type === "multi_selection" && value) {
|
|
348
|
+
if (Array.isArray(value)) {
|
|
349
|
+
data.ext_meta[field.var_name] = value.map(
|
|
350
|
+
(item) => typeof item === "object" ? item.key : item
|
|
351
|
+
);
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
if (field.var_type === "backend_user" && value) {
|
|
355
|
+
if (typeof value === "object") {
|
|
356
|
+
data.ext_meta[field.var_name] = value.uid || value.id;
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
if (field.var_type === "selection" && value) {
|
|
360
|
+
if (typeof value === "object") {
|
|
361
|
+
data.ext_meta[field.var_name] = value.key || value;
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
if (field.var_type === "switch") {
|
|
365
|
+
data.ext_meta[field.var_name] = !!value;
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
});
|
|
369
|
+
}
|
|
370
|
+
} else {
|
|
371
|
+
data.ext_meta = {};
|
|
372
|
+
}
|
|
231
373
|
Object.assign(form.value, data);
|
|
232
374
|
};
|
|
233
375
|
vue.watch(silenceOptions, (newVal, oldVal) => {
|
|
@@ -268,6 +410,20 @@ const _sfc_main = vue.defineComponent({
|
|
|
268
410
|
},
|
|
269
411
|
{ immediate: true }
|
|
270
412
|
);
|
|
413
|
+
vue.watch(
|
|
414
|
+
() => props.extendedFieldsConfig,
|
|
415
|
+
(newConfig) => {
|
|
416
|
+
if (newConfig && newConfig.length > 0) {
|
|
417
|
+
const hasBackendUserField = newConfig.some(
|
|
418
|
+
(field) => field.var_type === "backend_user"
|
|
419
|
+
);
|
|
420
|
+
if (hasBackendUserField) {
|
|
421
|
+
getBackendUsersOption();
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
},
|
|
425
|
+
{ immediate: true }
|
|
426
|
+
);
|
|
271
427
|
vue.onMounted(() => {
|
|
272
428
|
getAllDutyEditorOption();
|
|
273
429
|
if (props.sourceStore) {
|
|
@@ -280,6 +436,7 @@ const _sfc_main = vue.defineComponent({
|
|
|
280
436
|
getFormData
|
|
281
437
|
});
|
|
282
438
|
return (_ctx, _cache) => {
|
|
439
|
+
const _component_a_textarea = vue.resolveComponent("a-textarea");
|
|
283
440
|
return vue.openBlock(), vue.createBlock(vue.unref(webVue.Form), {
|
|
284
441
|
ref_key: "metaInfoFormRef",
|
|
285
442
|
ref: metaInfoFormRef,
|
|
@@ -784,7 +941,191 @@ const _sfc_main = vue.defineComponent({
|
|
|
784
941
|
])) : vue.createCommentVNode("v-if", true)
|
|
785
942
|
]),
|
|
786
943
|
_: 1
|
|
787
|
-
})
|
|
944
|
+
}),
|
|
945
|
+
vue.createCommentVNode(" \u6269\u5C55\u5B57\u6BB5\u533A\u57DF "),
|
|
946
|
+
__props.extendedFieldsConfig && __props.extendedFieldsConfig.length > 0 ? (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 1 }, vue.renderList(__props.extendedFieldsConfig, (field) => {
|
|
947
|
+
return vue.openBlock(), vue.createElementBlock(vue.Fragment, {
|
|
948
|
+
key: field.var_name
|
|
949
|
+
}, [
|
|
950
|
+
vue.createCommentVNode(" \u6587\u672C\u7C7B\u578B "),
|
|
951
|
+
field.var_type === "text" ? (vue.openBlock(), vue.createBlock(vue.unref(webVue.FormItem), {
|
|
952
|
+
key: 0,
|
|
953
|
+
field: `ext_meta.${field.var_name}`,
|
|
954
|
+
label: field.name
|
|
955
|
+
}, {
|
|
956
|
+
default: vue.withCtx(() => [
|
|
957
|
+
vue.createVNode(vue.unref(webVue.Input), {
|
|
958
|
+
modelValue: form.value.ext_meta[field.var_name],
|
|
959
|
+
"onUpdate:modelValue": ($event) => form.value.ext_meta[field.var_name] = $event,
|
|
960
|
+
placeholder: `\u8BF7\u8F93\u5165${field.name}`,
|
|
961
|
+
"max-length": field.max_length || 100,
|
|
962
|
+
"allow-clear": "",
|
|
963
|
+
class: "input-w"
|
|
964
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder", "max-length"])
|
|
965
|
+
]),
|
|
966
|
+
_: 2
|
|
967
|
+
}, 1032, ["field", "label"])) : field.var_type === "textarea" ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
|
|
968
|
+
vue.createCommentVNode(" \u6587\u672C\u57DF\u7C7B\u578B "),
|
|
969
|
+
vue.createVNode(vue.unref(webVue.FormItem), {
|
|
970
|
+
field: `ext_meta.${field.var_name}`,
|
|
971
|
+
label: field.name
|
|
972
|
+
}, {
|
|
973
|
+
default: vue.withCtx(() => [
|
|
974
|
+
vue.createVNode(_component_a_textarea, {
|
|
975
|
+
modelValue: form.value.ext_meta[field.var_name],
|
|
976
|
+
"onUpdate:modelValue": ($event) => form.value.ext_meta[field.var_name] = $event,
|
|
977
|
+
placeholder: `\u8BF7\u8F93\u5165${field.name}`,
|
|
978
|
+
"max-length": field.max_length || 500,
|
|
979
|
+
"allow-clear": "",
|
|
980
|
+
class: "input-w"
|
|
981
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder", "max-length"])
|
|
982
|
+
]),
|
|
983
|
+
_: 2
|
|
984
|
+
}, 1032, ["field", "label"])
|
|
985
|
+
], 2112)) : field.var_type === "number" ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 2 }, [
|
|
986
|
+
vue.createCommentVNode(" \u6570\u5B57\u7C7B\u578B "),
|
|
987
|
+
vue.createVNode(vue.unref(webVue.FormItem), {
|
|
988
|
+
field: `ext_meta.${field.var_name}`,
|
|
989
|
+
label: field.name,
|
|
990
|
+
class: "horizontal"
|
|
991
|
+
}, {
|
|
992
|
+
default: vue.withCtx(() => [
|
|
993
|
+
vue.createVNode(vue.unref(webVue.InputNumber), {
|
|
994
|
+
modelValue: form.value.ext_meta[field.var_name],
|
|
995
|
+
"onUpdate:modelValue": ($event) => form.value.ext_meta[field.var_name] = $event,
|
|
996
|
+
placeholder: `\u8BF7\u8F93\u5165${field.name}`,
|
|
997
|
+
style: { width: "240px" }
|
|
998
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder"])
|
|
999
|
+
]),
|
|
1000
|
+
_: 2
|
|
1001
|
+
}, 1032, ["field", "label"])
|
|
1002
|
+
], 2112)) : field.var_type === "selection" ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 3 }, [
|
|
1003
|
+
vue.createCommentVNode(" \u5355\u9009\u7C7B\u578B "),
|
|
1004
|
+
vue.createVNode(vue.unref(webVue.FormItem), {
|
|
1005
|
+
field: `ext_meta.${field.var_name}`,
|
|
1006
|
+
label: field.name
|
|
1007
|
+
}, {
|
|
1008
|
+
default: vue.withCtx(() => [
|
|
1009
|
+
vue.createVNode(vue.unref(webVue.Select), {
|
|
1010
|
+
modelValue: form.value.ext_meta[field.var_name],
|
|
1011
|
+
"onUpdate:modelValue": ($event) => form.value.ext_meta[field.var_name] = $event,
|
|
1012
|
+
placeholder: `\u8BF7\u9009\u62E9${field.name}`,
|
|
1013
|
+
class: "input-w",
|
|
1014
|
+
"allow-clear": ""
|
|
1015
|
+
}, {
|
|
1016
|
+
default: vue.withCtx(() => [
|
|
1017
|
+
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(field.select_options || [], (option) => {
|
|
1018
|
+
return vue.openBlock(), vue.createBlock(vue.unref(webVue.Option), {
|
|
1019
|
+
key: option.key,
|
|
1020
|
+
value: option.key,
|
|
1021
|
+
label: option.value
|
|
1022
|
+
}, null, 8, ["value", "label"]);
|
|
1023
|
+
}), 128))
|
|
1024
|
+
]),
|
|
1025
|
+
_: 2
|
|
1026
|
+
}, 1032, ["modelValue", "onUpdate:modelValue", "placeholder"])
|
|
1027
|
+
]),
|
|
1028
|
+
_: 2
|
|
1029
|
+
}, 1032, ["field", "label"])
|
|
1030
|
+
], 2112)) : field.var_type === "multi_selection" ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 4 }, [
|
|
1031
|
+
vue.createCommentVNode(" \u591A\u9009\u7C7B\u578B "),
|
|
1032
|
+
vue.createVNode(vue.unref(webVue.FormItem), {
|
|
1033
|
+
field: `ext_meta.${field.var_name}`,
|
|
1034
|
+
label: field.name
|
|
1035
|
+
}, {
|
|
1036
|
+
default: vue.withCtx(() => [
|
|
1037
|
+
vue.createVNode(vue.unref(webVue.Select), {
|
|
1038
|
+
modelValue: form.value.ext_meta[field.var_name],
|
|
1039
|
+
"onUpdate:modelValue": ($event) => form.value.ext_meta[field.var_name] = $event,
|
|
1040
|
+
placeholder: `\u8BF7\u9009\u62E9${field.name}`,
|
|
1041
|
+
class: "input-w",
|
|
1042
|
+
multiple: "",
|
|
1043
|
+
"allow-clear": ""
|
|
1044
|
+
}, {
|
|
1045
|
+
default: vue.withCtx(() => [
|
|
1046
|
+
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(field.select_options || [], (option) => {
|
|
1047
|
+
return vue.openBlock(), vue.createBlock(vue.unref(webVue.Option), {
|
|
1048
|
+
key: option.key,
|
|
1049
|
+
value: option.key,
|
|
1050
|
+
label: option.value
|
|
1051
|
+
}, null, 8, ["value", "label"]);
|
|
1052
|
+
}), 128))
|
|
1053
|
+
]),
|
|
1054
|
+
_: 2
|
|
1055
|
+
}, 1032, ["modelValue", "onUpdate:modelValue", "placeholder"])
|
|
1056
|
+
]),
|
|
1057
|
+
_: 2
|
|
1058
|
+
}, 1032, ["field", "label"])
|
|
1059
|
+
], 2112)) : field.var_type === "datetime" ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 5 }, [
|
|
1060
|
+
vue.createCommentVNode(" \u65E5\u671F\u65F6\u95F4\u7C7B\u578B "),
|
|
1061
|
+
vue.createVNode(vue.unref(webVue.FormItem), {
|
|
1062
|
+
field: `ext_meta.${field.var_name}`,
|
|
1063
|
+
label: field.name,
|
|
1064
|
+
class: "horizontal"
|
|
1065
|
+
}, {
|
|
1066
|
+
default: vue.withCtx(() => {
|
|
1067
|
+
var _a;
|
|
1068
|
+
return [
|
|
1069
|
+
vue.createVNode(vue.unref(webVue.DatePicker), {
|
|
1070
|
+
modelValue: form.value.ext_meta[field.var_name],
|
|
1071
|
+
"onUpdate:modelValue": ($event) => form.value.ext_meta[field.var_name] = $event,
|
|
1072
|
+
"show-time": (_a = field.date_format) == null ? void 0 : _a.includes("15:04"),
|
|
1073
|
+
placeholder: `\u8BF7\u9009\u62E9${field.name}`,
|
|
1074
|
+
"time-picker-props": { defaultValue: "12:00:00" },
|
|
1075
|
+
format: field.date_format === "2006-01-02" ? "YYYY-MM-DD" : "YYYY-MM-DD HH:mm",
|
|
1076
|
+
"value-format": "YYYY-MM-DD HH:mm:ss"
|
|
1077
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "show-time", "placeholder", "format"])
|
|
1078
|
+
];
|
|
1079
|
+
}),
|
|
1080
|
+
_: 2
|
|
1081
|
+
}, 1032, ["field", "label"])
|
|
1082
|
+
], 2112)) : field.var_type === "backend_user" ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 6 }, [
|
|
1083
|
+
vue.createCommentVNode(" \u540E\u53F0\u7528\u6237\u7C7B\u578B "),
|
|
1084
|
+
vue.createVNode(vue.unref(webVue.FormItem), {
|
|
1085
|
+
field: `ext_meta.${field.var_name}`,
|
|
1086
|
+
label: field.name
|
|
1087
|
+
}, {
|
|
1088
|
+
default: vue.withCtx(() => [
|
|
1089
|
+
vue.createVNode(vue.unref(webVue.Select), {
|
|
1090
|
+
modelValue: form.value.ext_meta[field.var_name],
|
|
1091
|
+
"onUpdate:modelValue": ($event) => form.value.ext_meta[field.var_name] = $event,
|
|
1092
|
+
placeholder: `\u8BF7\u9009\u62E9${field.name}`,
|
|
1093
|
+
class: "input-w",
|
|
1094
|
+
filterable: "",
|
|
1095
|
+
"allow-clear": ""
|
|
1096
|
+
}, {
|
|
1097
|
+
default: vue.withCtx(() => [
|
|
1098
|
+
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(backendUsersOptions.value, (user) => {
|
|
1099
|
+
return vue.openBlock(), vue.createBlock(vue.unref(webVue.Option), {
|
|
1100
|
+
key: user.value,
|
|
1101
|
+
value: user.value,
|
|
1102
|
+
label: user.label
|
|
1103
|
+
}, null, 8, ["value", "label"]);
|
|
1104
|
+
}), 128))
|
|
1105
|
+
]),
|
|
1106
|
+
_: 1
|
|
1107
|
+
}, 8, ["modelValue", "onUpdate:modelValue", "placeholder"])
|
|
1108
|
+
]),
|
|
1109
|
+
_: 2
|
|
1110
|
+
}, 1032, ["field", "label"])
|
|
1111
|
+
], 2112)) : field.var_type === "switch" ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 7 }, [
|
|
1112
|
+
vue.createCommentVNode(" \u5F00\u5173\u7C7B\u578B "),
|
|
1113
|
+
vue.createVNode(vue.unref(webVue.FormItem), {
|
|
1114
|
+
field: `ext_meta.${field.var_name}`,
|
|
1115
|
+
label: field.name,
|
|
1116
|
+
class: "horizontal"
|
|
1117
|
+
}, {
|
|
1118
|
+
default: vue.withCtx(() => [
|
|
1119
|
+
vue.createVNode(vue.unref(webVue.Switch), {
|
|
1120
|
+
modelValue: form.value.ext_meta[field.var_name],
|
|
1121
|
+
"onUpdate:modelValue": ($event) => form.value.ext_meta[field.var_name] = $event
|
|
1122
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue"])
|
|
1123
|
+
]),
|
|
1124
|
+
_: 2
|
|
1125
|
+
}, 1032, ["field", "label"])
|
|
1126
|
+
], 2112)) : vue.createCommentVNode("v-if", true)
|
|
1127
|
+
], 64);
|
|
1128
|
+
}), 128)) : vue.createCommentVNode("v-if", true)
|
|
788
1129
|
]),
|
|
789
1130
|
_: 1
|
|
790
1131
|
}, 8, ["model"]);
|
|
@@ -16,5 +16,26 @@ function getAllDutyEditor(BASE_API, params) {
|
|
|
16
16
|
method: "get"
|
|
17
17
|
});
|
|
18
18
|
}
|
|
19
|
+
function getEnabledExtendedFields(BASE_API, params) {
|
|
20
|
+
return request(BASE_API, {
|
|
21
|
+
url: "/poplar/v3/extend-fields/pubmedia/fields/enabled",
|
|
22
|
+
method: "get",
|
|
23
|
+
params
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
function getBackendUsers(BASE_API, params) {
|
|
27
|
+
return request(BASE_API, {
|
|
28
|
+
url: `/poplar/v2/accounts/${params.domainId}`,
|
|
29
|
+
method: "get",
|
|
30
|
+
params: {
|
|
31
|
+
keywords: params.keywords || "",
|
|
32
|
+
limit: params.limit || 1e4,
|
|
33
|
+
offset: params.offset || 0,
|
|
34
|
+
where: "state:0,role:0"
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
}
|
|
19
38
|
exports.getAllDutyEditor = getAllDutyEditor;
|
|
39
|
+
exports.getBackendUsers = getBackendUsers;
|
|
20
40
|
exports.getDocDetailsNew = getDocDetailsNew;
|
|
41
|
+
exports.getEnabledExtendedFields = getEnabledExtendedFields;
|