kouxiangtang 0.0.96 → 0.0.97
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/dist/{AttachmentUploader-COZQHNcy.js → AttachmentUploader-NoWeqOkk.js} +2 -2
- package/dist/{AttachmentUploader-COZQHNcy.js.map → AttachmentUploader-NoWeqOkk.js.map} +1 -1
- package/dist/{ImageUploader-C4aC6mAT.js → ImageUploader-zsC2h0aX.js} +2 -2
- package/dist/{ImageUploader-C4aC6mAT.js.map → ImageUploader-zsC2h0aX.js.map} +1 -1
- package/dist/{ImagesUploader-De_dU2hM.js → ImagesUploader-DF6isqFQ.js} +2 -2
- package/dist/{ImagesUploader-De_dU2hM.js.map → ImagesUploader-DF6isqFQ.js.map} +1 -1
- package/dist/{RichTextEditor-hiNKzwKZ.js → RichTextEditor-Y889dJnt.js} +2 -2
- package/dist/{RichTextEditor-hiNKzwKZ.js.map → RichTextEditor-Y889dJnt.js.map} +1 -1
- package/dist/{config-ZfmBVaCj.js → config-3DY41Mp4.js} +2 -2
- package/dist/{config-ZfmBVaCj.js.map → config-3DY41Mp4.js.map} +1 -1
- package/dist/{config-D0dleR0S.js → config-3vRpjcT7.js} +3 -3
- package/dist/{config-D0dleR0S.js.map → config-3vRpjcT7.js.map} +1 -1
- package/dist/{config-Cc7l8-Sa.js → config-BI92Snqx.js} +2 -2
- package/dist/{config-Cc7l8-Sa.js.map → config-BI92Snqx.js.map} +1 -1
- package/dist/{config-BLf4r3qX.js → config-BUiTIZGn.js} +2 -2
- package/dist/{config-BLf4r3qX.js.map → config-BUiTIZGn.js.map} +1 -1
- package/dist/{config-D33qAwRc.js → config-BUx3sloi.js} +2 -2
- package/dist/{config-D33qAwRc.js.map → config-BUx3sloi.js.map} +1 -1
- package/dist/{config-BksyI0mB.js → config-Bxl4Qa31.js} +2 -2
- package/dist/{config-BksyI0mB.js.map → config-Bxl4Qa31.js.map} +1 -1
- package/dist/{config-BQ5S6q_B.js → config-CFvanfuV.js} +2 -2
- package/dist/{config-BQ5S6q_B.js.map → config-CFvanfuV.js.map} +1 -1
- package/dist/{config-xkPBdiAn.js → config-CI8B5t-F.js} +2 -2
- package/dist/{config-xkPBdiAn.js.map → config-CI8B5t-F.js.map} +1 -1
- package/dist/{config-DnGzJrQF.js → config-CTRMcboP.js} +2 -2
- package/dist/{config-DnGzJrQF.js.map → config-CTRMcboP.js.map} +1 -1
- package/dist/{config-VLQD-sU0.js → config-CYcj7J-o.js} +2 -2
- package/dist/{config-VLQD-sU0.js.map → config-CYcj7J-o.js.map} +1 -1
- package/dist/{config-DqBza0WN.js → config-CgFRcnBi.js} +2 -2
- package/dist/{config-DqBza0WN.js.map → config-CgFRcnBi.js.map} +1 -1
- package/dist/{config-C3nyabTV.js → config-CjZUjDY2.js} +2 -2
- package/dist/{config-C3nyabTV.js.map → config-CjZUjDY2.js.map} +1 -1
- package/dist/{config-DEAz0WU-.js → config-CrctYtyZ.js} +2 -2
- package/dist/{config-DEAz0WU-.js.map → config-CrctYtyZ.js.map} +1 -1
- package/dist/{config-CtAdzI_6.js → config-DWsmGOe4.js} +2 -2
- package/dist/{config-CtAdzI_6.js.map → config-DWsmGOe4.js.map} +1 -1
- package/dist/{config-DnEhSLbl.js → config-DblgYyzf.js} +2 -2
- package/dist/{config-DnEhSLbl.js.map → config-DblgYyzf.js.map} +1 -1
- package/dist/{config-piCkRxzj.js → config-Dh3-JPZF.js} +3 -3
- package/dist/{config-piCkRxzj.js.map → config-Dh3-JPZF.js.map} +1 -1
- package/dist/config-DpRuceEZ.js +81 -0
- package/dist/config-DpRuceEZ.js.map +1 -0
- package/dist/{config-jw8a574O.js → config-YJV5HV4J.js} +2 -2
- package/dist/{config-jw8a574O.js.map → config-YJV5HV4J.js.map} +1 -1
- package/dist/{config-Cu5nUjh-.js → config-enmhhwQ8.js} +3 -3
- package/dist/{config-Cu5nUjh-.js.map → config-enmhhwQ8.js.map} +1 -1
- package/dist/{config-Dja3750L.js → config-v-QQU1RL.js} +2 -2
- package/dist/{config-Dja3750L.js.map → config-v-QQU1RL.js.map} +1 -1
- package/dist/{index-BUY-30A-.js → index-BCvBK2Fr.js} +1071 -1062
- package/dist/index-BCvBK2Fr.js.map +1 -0
- package/dist/kouxiangtang.js +1 -1
- package/dist/kouxiangtang.umd.cjs +9 -9
- package/dist/kouxiangtang.umd.cjs.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/dist/config-CgqR1Cvc.js +0 -81
- package/dist/config-CgqR1Cvc.js.map +0 -1
- package/dist/index-BUY-30A-.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config-
|
|
1
|
+
{"version":3,"file":"config-DWsmGOe4.js","sources":["../src/framework/field/select/FieldDisplay.vue","../src/framework/field/select/FieldEditor.vue","../src/framework/field/select/config.js"],"sourcesContent":["<script setup>\r\nimport { ElTooltip } from \"element-plus\";\r\nimport color from \"../../utils/color\";\r\nimport EmptyTip from \"../../component/EmptyTip.vue\";\r\nimport { ref, watch } from \"vue\";\r\nimport { useRoute } from \"vue-router\";\r\nimport { setupRouteQuery } from \"../../utils/route-query\";\r\n\r\nconst route = useRoute();\r\nconst routeQuery = setupRouteQuery(route);\r\nconst props = defineProps({\r\n field: {\r\n type: Object,\r\n },\r\n row: {\r\n type: Object,\r\n },\r\n});\r\nconst invalidTip = ref(\"...\");\r\nconst found = ref(false);\r\nconst items = ref([]);\r\n\r\nasync function getSelectName() {\r\n const val = props.row[props.field.code];\r\n const label = props.field.label;\r\n if (val === undefined || val === null) {\r\n invalidTip.value = \"<无>\";\r\n found.value = false;\r\n return;\r\n }\r\n\r\n const options = await props.field.options(props.row, routeQuery);\r\n if (!options) {\r\n invalidTip.value = `<无>`;\r\n found.value = false;\r\n return;\r\n }\r\n\r\n let selectedOptions = [];\r\n if (props.field.multiple) {\r\n selectedOptions = options.filter((item) => val.includes(item.code));\r\n } else {\r\n selectedOptions = options.filter((item) => val === item.code);\r\n }\r\n\r\n if (selectedOptions.length === 0) {\r\n invalidTip.value = `<无>`;\r\n found.value = false;\r\n return;\r\n }\r\n\r\n items.value = selectedOptions.map((item) => ({\r\n bgColor: color.strToHexColor(`${item.code}-${item.name}`),\r\n code: item.code,\r\n name: item.name,\r\n }));\r\n\r\n found.value = true;\r\n}\r\n\r\nwatch(() => props.row, getSelectName, { immediate: true });\r\n</script>\r\n\r\n<template>\r\n <template v-if=\"found\">\r\n <div class=\"select-fields\">\r\n <el-tooltip\r\n v-for=\"item in items\"\r\n :content=\"`${item.name}`\"\r\n placement=\"top\"\r\n >\r\n <div class=\"select-field found\" :style=\"`background: ${item.bgColor}`\">\r\n {{ item.name }}\r\n </div>\r\n </el-tooltip>\r\n </div>\r\n </template>\r\n <EmptyTip v-else :text=\"invalidTip\" />\r\n</template>\r\n\r\n<style scoped lang=\"scss\">\r\n.select-fields {\r\n display: inline-block;\r\n line-height: inherit;\r\n}\r\n\r\n.select-field {\r\n font-size: 12px;\r\n padding: 0 6px;\r\n border-radius: 4px;\r\n}\r\n\r\n.found {\r\n color: #fff;\r\n}\r\n</style>\r\n","<template>\r\n <el-select\r\n v-model=\"_form.value\"\r\n style=\"width: 100%\"\r\n filterable\r\n reserve-keyword\r\n remote-show-suffix\r\n clearable\r\n fit-input-width\r\n :multiple=\"props.field.multiple\"\r\n :disabled=\"props.disabled\"\r\n :placeholder=\"field.placeholder\"\r\n remote\r\n :remote-method=\"remoteSearch\"\r\n @change=\"change\"\r\n >\r\n <template v-if=\"field.prefix\" #prefix>{{ field.prefix }}</template>\r\n <template v-for=\"option in options\" :key=\"option.code\">\r\n <el-option\r\n :label=\"option.name\"\r\n :value=\"option.code\"\r\n :title=\"option.name\"\r\n :disabled=\"option.disabled\"\r\n />\r\n </template>\r\n </el-select>\r\n</template>\r\n\r\n<script setup>\r\nimport { ElSelect, ElOption } from \"element-plus\";\r\nimport { reactive, watch, ref } from \"vue\";\r\nimport { useRoute } from \"vue-router\";\r\nimport { setupRouteQuery } from \"../../utils/route-query\";\r\n\r\nconst route = useRoute();\r\nconst routeQuery = setupRouteQuery(route);\r\nconst emit = defineEmits([\"update:modelValue\"]);\r\nconst props = defineProps({\r\n modelValue: [String, Number, Array],\r\n field: Object,\r\n type: String,\r\n disabled: Boolean,\r\n formData: Object,\r\n});\r\nconst _form = reactive({ value: props.modelValue });\r\nconst options = ref([]);\r\n\r\nasync function remoteSearch(keyword) {\r\n options.value = await props.field.options(\r\n props.formData,\r\n routeQuery,\r\n keyword,\r\n );\r\n}\r\n\r\nfunction change() {\r\n emit(\"update:modelValue\", _form.value);\r\n}\r\n\r\nwatch(\r\n () => props.modelValue,\r\n () => {\r\n _form.value = props.modelValue;\r\n },\r\n { immediate: true },\r\n);\r\nremoteSearch();\r\n</script>\r\n\r\n<style scoped lang=\"scss\"></style>\r\n","import BaseFieldConfig from \"../base-field-config\";\r\nimport FieldDisplay from \"./FieldDisplay.vue\";\r\nimport FieldEditor from \"./FieldEditor.vue\";\r\n\r\nclass SelectFieldConfig extends BaseFieldConfig {\r\n constructor(rawConfig, domain) {\r\n super(rawConfig, domain);\r\n this.options = rawConfig.options || (() => [{ code: 0, name: \"未实现\" }]);\r\n this.formChange = rawConfig.formChange || (() => {});\r\n this.display = FieldDisplay;\r\n this.editor = FieldEditor;\r\n this.multiple = this.defaultBy(rawConfig.multiple, false);\r\n\r\n this.checkValidProperties(rawConfig);\r\n }\r\n}\r\n\r\nexport default SelectFieldConfig;\r\n"],"names":["route","useRoute","routeQuery","setupRouteQuery","props","__props","invalidTip","ref","found","items","getSelectName","val","options","selectedOptions","item","color","watch","emit","__emit","_form","reactive","remoteSearch","keyword","change","SelectFieldConfig","BaseFieldConfig","rawConfig","domain","FieldDisplay","FieldEditor"],"mappings":";;;;;;;;;;;;;;;;;;;AAQA,UAAMA,IAAQC,EAAQ,GAChBC,IAAaC,EAAgBH,CAAK,GAClCI,IAAQC,GAQRC,IAAaC,EAAI,KAAK,GACtBC,IAAQD,EAAI,EAAK,GACjBE,IAAQF,EAAI,CAAA,CAAE;AAEpB,mBAAeG,IAAgB;AAC7B,YAAMC,IAAMP,EAAM,IAAIA,EAAM,MAAM,IAAI;AAEtC,UADcA,EAAM,MAAM,OACDO,KAAQ,MAAM;AACrC,QAAAL,EAAW,QAAQ,OACnBE,EAAM,QAAQ;AACd;AAAA,MACD;AAED,YAAMI,IAAU,MAAMR,EAAM,MAAM,QAAQA,EAAM,KAAKF,CAAU;AAC/D,UAAI,CAACU,GAAS;AACZ,QAAAN,EAAW,QAAQ,OACnBE,EAAM,QAAQ;AACd;AAAA,MACD;AAED,UAAIK,IAAkB,CAAA;AAOtB,UANIT,EAAM,MAAM,WACdS,IAAkBD,EAAQ,OAAO,CAACE,MAASH,EAAI,SAASG,EAAK,IAAI,CAAC,IAElED,IAAkBD,EAAQ,OAAO,CAACE,MAASH,MAAQG,EAAK,IAAI,GAG1DD,EAAgB,WAAW,GAAG;AAChC,QAAAP,EAAW,QAAQ,OACnBE,EAAM,QAAQ;AACd;AAAA,MACD;AAED,MAAAC,EAAM,QAAQI,EAAgB,IAAI,CAACC,OAAU;AAAA,QAC3C,SAASC,EAAM,cAAc,GAAGD,EAAK,IAAI,IAAIA,EAAK,IAAI,EAAE;AAAA,QACxD,MAAMA,EAAK;AAAA,QACX,MAAMA,EAAK;AAAA,MACZ,EAAC,GAEFN,EAAM,QAAQ;AAAA,IAChB;AAEA,WAAAQ,EAAM,MAAMZ,EAAM,KAAKM,GAAe,EAAE,WAAW,GAAI,CAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC1BzD,UAAMV,IAAQC,EAAQ,GAChBC,IAAaC,EAAgBH,CAAK,GAClCiB,IAAOC,GACPd,IAAQC,GAORc,IAAQC,EAAS,EAAE,OAAOhB,EAAM,WAAY,CAAA,GAC5CQ,IAAUL,EAAI,CAAA,CAAE;AAEtB,mBAAec,EAAaC,GAAS;AACnC,MAAAV,EAAQ,QAAQ,MAAMR,EAAM,MAAM;AAAA,QAChCA,EAAM;AAAA,QACNF;AAAA,QACAoB;AAAA,MACJ;AAAA,IACA;AAEA,aAASC,IAAS;AAChB,MAAAN,EAAK,qBAAqBE,EAAM,KAAK;AAAA,IACvC;AAEA,WAAAH;AAAA,MACE,MAAMZ,EAAM;AAAA,MACZ,MAAM;AACJ,QAAAe,EAAM,QAAQf,EAAM;AAAA,MACrB;AAAA,MACD,EAAE,WAAW,GAAM;AAAA,IACrB,GACAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC9DA,MAAMG,UAA0BC,EAAgB;AAAA,EAC9C,YAAYC,GAAWC,GAAQ;AAC7B,UAAMD,GAAWC,CAAM,GACvB,KAAK,UAAUD,EAAU,YAAY,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,MAAK,CAAE,IACpE,KAAK,aAAaA,EAAU,eAAe,MAAM;AAAA,IAAE,IACnD,KAAK,UAAUE,GACf,KAAK,SAASC,GACd,KAAK,WAAW,KAAK,UAAUH,EAAU,UAAU,EAAK,GAExD,KAAK,qBAAqBA,CAAS;AAAA,EACpC;AACH;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as i, F as s } from "./index-
|
|
1
|
+
import { B as i, F as s } from "./index-BCvBK2Fr.js";
|
|
2
2
|
class u extends i {
|
|
3
3
|
constructor(t, e) {
|
|
4
4
|
super(t, e), this.editable = () => !1, this.isRouter = this.isRouter(t), this.rowQuery = t.rowQuery || (() => ({})), this.display = s, this.fixed = !0, this.checkValidProperties(t);
|
|
@@ -17,4 +17,4 @@ class u extends i {
|
|
|
17
17
|
export {
|
|
18
18
|
u as default
|
|
19
19
|
};
|
|
20
|
-
//# sourceMappingURL=config-
|
|
20
|
+
//# sourceMappingURL=config-DblgYyzf.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config-
|
|
1
|
+
{"version":3,"file":"config-DblgYyzf.js","sources":["../src/framework/field/row-id/config.js"],"sourcesContent":["import BaseFieldConfig from \"../base-field-config\";\r\nimport FieldDisplay from \"./FieldDisplay.vue\";\r\n\r\nexport default class RowIdFieldConfig extends BaseFieldConfig {\r\n constructor(rawConfig, domain) {\r\n super(rawConfig, domain);\r\n this.editable = () => false;\r\n this.isRouter = this.isRouter(rawConfig);\r\n this.rowQuery = rawConfig.rowQuery || (() => ({}));\r\n this.display = FieldDisplay;\r\n this.fixed = true;\r\n\r\n this.checkValidProperties(rawConfig);\r\n }\r\n\r\n isRouter(rawConfig) {\r\n const raw = rawConfig.isRouter;\r\n\r\n if (typeof raw == \"boolean\") {\r\n return () => raw;\r\n }\r\n\r\n if (typeof raw == \"function\") {\r\n return raw;\r\n }\r\n\r\n if (typeof raw == \"undefined\") {\r\n return () => true;\r\n }\r\n\r\n throw new Exception(`invalid isRouter : ${raw}`);\r\n }\r\n}\r\n"],"names":["RowIdFieldConfig","BaseFieldConfig","rawConfig","domain","FieldDisplay","raw"],"mappings":";AAGe,MAAMA,UAAyBC,EAAgB;AAAA,EAC5D,YAAYC,GAAWC,GAAQ;AAC7B,UAAMD,GAAWC,CAAM,GACvB,KAAK,WAAW,MAAM,IACtB,KAAK,WAAW,KAAK,SAASD,CAAS,GACvC,KAAK,WAAWA,EAAU,aAAa,OAAO,CAAA,KAC9C,KAAK,UAAUE,GACf,KAAK,QAAQ,IAEb,KAAK,qBAAqBF,CAAS;AAAA,EACpC;AAAA,EAED,SAASA,GAAW;AAClB,UAAMG,IAAMH,EAAU;AAEtB,QAAI,OAAOG,KAAO;AAChB,aAAO,MAAMA;AAGf,QAAI,OAAOA,KAAO;AAChB,aAAOA;AAGT,QAAI,OAAOA,IAAO;AAChB,aAAO,MAAM;AAGf,UAAM,IAAI,UAAU,sBAAsBA,CAAG,EAAE;AAAA,EAChD;AACH;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as b, d as E, a as O, v as C, E as F, B as V } from "./index-
|
|
1
|
+
import { _ as b, d as E, a as O, v as C, E as F, B as V } from "./index-BCvBK2Fr.js";
|
|
2
2
|
import { ref as j, watch as B, openBlock as u, createElementBlock as f, Fragment as T, renderList as A, createElementVNode as h, createVNode as c, unref as i, withCtx as _, toDisplayString as w, createBlock as k, createCommentVNode as I, defineAsyncComponent as L, reactive as N } from "vue";
|
|
3
3
|
import { ElIcon as y, ElLink as D, ElMessage as x } from "element-plus";
|
|
4
4
|
const P = { key: 0 }, R = { class: "file-name" }, U = { class: "name" }, $ = { class: "file-type" }, z = { key: 1 }, S = {
|
|
@@ -90,7 +90,7 @@ const P = { key: 0 }, R = { class: "file-name" }, U = { class: "name" }, $ = { c
|
|
|
90
90
|
},
|
|
91
91
|
emits: ["update:modelValue"],
|
|
92
92
|
setup(p, { emit: a }) {
|
|
93
|
-
const l = L(() => import("./AttachmentUploader-
|
|
93
|
+
const l = L(() => import("./AttachmentUploader-NoWeqOkk.js")), m = a, d = p, e = N({ value: d.modelValue });
|
|
94
94
|
function o(s) {
|
|
95
95
|
e.value = e.value ? [...e.value, s] : [s];
|
|
96
96
|
}
|
|
@@ -150,4 +150,4 @@ class Q extends V {
|
|
|
150
150
|
export {
|
|
151
151
|
Q as default
|
|
152
152
|
};
|
|
153
|
-
//# sourceMappingURL=config-
|
|
153
|
+
//# sourceMappingURL=config-Dh3-JPZF.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config-
|
|
1
|
+
{"version":3,"file":"config-Dh3-JPZF.js","sources":["../src/framework/field/attachment/FieldDisplay.vue","../src/framework/field/attachment/FieldEditor.vue","../src/framework/field/attachment/config.js"],"sourcesContent":["<template>\r\n <div v-if=\"attachments.length > 0\">\r\n <div v-for=\"file in attachments\">\r\n <div class=\"file-name\">\r\n <el-icon color=\"#73767a\">\r\n <Document />\r\n </el-icon>\r\n <span class=\"name\">{{ file.name }}</span>\r\n <span class=\"file-type\">.{{ file.fileType }}</span>\r\n <el-icon color=\"#409eff\" size=\"16\" @click=\"download(file)\">\r\n <Download />\r\n </el-icon>\r\n <el-link\r\n v-if=\"file.isPreview\"\r\n type=\"primary\"\r\n :href=\"file.url\"\r\n target=\"_blank\"\r\n :underline=\"false\"\r\n >\r\n <el-icon size=\"16\">\r\n <View />\r\n </el-icon>\r\n </el-link>\r\n </div>\r\n </div>\r\n </div>\r\n <div v-else>\r\n <EmptyTip />\r\n </div>\r\n</template>\r\n\r\n<script setup>\r\nimport { ElIcon, ElLink } from \"element-plus\";\r\nimport { Document, Download, View } from \"@element-plus/icons-vue\";\r\nimport EmptyTip from \"../../component/EmptyTip.vue\";\r\nimport { ref, watch } from \"vue\";\r\n\r\nconst props = defineProps({\r\n field: {\r\n type: Object,\r\n },\r\n row: {\r\n type: Object,\r\n },\r\n});\r\nconst attachments = ref([]);\r\n\r\nfunction download(file) {\r\n fetch(file.url)\r\n .then((res) => res.blob())\r\n .then((blob) => {\r\n const link = document.createElement(\"a\");\r\n if (blob.type == \"application/x-rar-compressed\") {\r\n link.href = file.url;\r\n } else {\r\n link.href = URL.createObjectURL(blob);\r\n }\r\n link.download = file.name;\r\n document.body.appendChild(link);\r\n link.click();\r\n });\r\n}\r\n\r\nfunction isPreview(fileType) {\r\n const imageExtensions = [\"jpg\", \"jpeg\", \"png\", \"gif\", \"webp\", \"bmp\", \"pdf\"];\r\n return imageExtensions.includes(fileType);\r\n}\r\n\r\nwatch(\r\n () => props.row,\r\n () => {\r\n attachments.value = props.row[props.field.code].map((item) => {\r\n const fileType = item.url.substring(item.url.lastIndexOf(\".\") + 1);\r\n return {\r\n ...item,\r\n fileType: fileType,\r\n isPreview: isPreview(fileType),\r\n };\r\n });\r\n },\r\n { immediate: true },\r\n);\r\n</script>\r\n\r\n<style scoped lang=\"scss\">\r\n.file-name {\r\n display: flex;\r\n align-items: center;\r\n margin: 10px 0 5px 0;\r\n .file-type {\r\n height: 22px;\r\n line-height: 22px;\r\n margin-right: 5px;\r\n background: #eeeeee;\r\n border-radius: 4px;\r\n font-size: 12px;\r\n padding: 0 4px;\r\n }\r\n .name {\r\n margin: 0 5px;\r\n }\r\n}\r\n:deep(.el-icon) {\r\n margin: 0 5px;\r\n cursor: pointer;\r\n}\r\n</style>\r\n","<template>\r\n <AttachmentUploader\r\n :pics=\"_form.value\"\r\n :props=\"props.field.props ? props.field.props : {}\"\r\n @on-success=\"(file) => change(file, 'success')\"\r\n @on-remove=\"(file) => change(file, 'remove')\"\r\n @on-change=\"(file) => change(file, 'change')\"\r\n />\r\n</template>\r\n\r\n<script setup>\r\nimport { reactive, defineAsyncComponent } from \"vue\";\r\nimport { ElMessage } from \"element-plus\";\r\n\r\nconst AttachmentUploader = defineAsyncComponent(() => {\r\n return import(\"./AttachmentUploader.vue\");\r\n});\r\n\r\nconst emit = defineEmits([\"update:modelValue\"]);\r\nconst props = defineProps({\r\n modelValue: Array,\r\n field: Object,\r\n domainConfig: Object,\r\n disabled: Boolean,\r\n formData: Object,\r\n});\r\nconst _form = reactive({ value: props.modelValue });\r\n\r\nfunction add(attachment) {\r\n _form.value = _form.value ? [..._form.value, attachment] : [attachment];\r\n}\r\n\r\nfunction remove(attachment) {\r\n const index = _form.value.findIndex((item) => item.id === attachment.id);\r\n _form.value.splice(index, 1);\r\n}\r\n\r\nasync function updateFileName(attachment) {\r\n const restApi = props.domainConfig.rest;\r\n const regex = /^[\\u4e00-\\u9fa5\\w-_]+$/;\r\n\r\n if (!regex.test(attachment.name)) {\r\n ElMessage({\r\n message: \"请勿输入特殊字符!\",\r\n type: \"warning\",\r\n });\r\n return;\r\n }\r\n\r\n await restApi.updateFilesName(attachment).then(() => {\r\n ElMessage({\r\n message: \"附件名称已修改!\",\r\n type: \"success\",\r\n });\r\n });\r\n}\r\n\r\nfunction change(image, type) {\r\n if (type == \"success\") {\r\n add(image);\r\n emit(\"update:modelValue\", _form.value);\r\n return;\r\n }\r\n\r\n if (type == \"remove\") {\r\n remove(image);\r\n emit(\"update:modelValue\", _form.value);\r\n return;\r\n }\r\n\r\n if (type == \"change\") {\r\n updateFileName(image);\r\n return;\r\n }\r\n}\r\n</script>\r\n\r\n<style scoped lang=\"scss\"></style>\r\n","import BaseFieldConfig from \"../base-field-config\";\r\nimport FieldDisplay from \"./FieldDisplay.vue\";\r\nimport FieldEditor from \"./FieldEditor.vue\";\r\n\r\nexport default class AttachmentFieldConfig extends BaseFieldConfig {\r\n constructor(rawConfig, domain) {\r\n super(rawConfig, domain);\r\n this.attachmentType = rawConfig.attachmentType;\r\n this.props = rawConfig.props;\r\n this.display = FieldDisplay;\r\n this.editor = FieldEditor;\r\n this.checkValidProperties(rawConfig);\r\n }\r\n\r\n defaultConfig() {\r\n return {\r\n showInList: false,\r\n };\r\n }\r\n}\r\n"],"names":["props","__props","attachments","ref","download","file","res","blob","link","isPreview","fileType","watch","item","AttachmentUploader","defineAsyncComponent","emit","__emit","_form","reactive","add","attachment","remove","index","updateFileName","restApi","ElMessage","change","image","type","AttachmentFieldConfig","BaseFieldConfig","rawConfig","domain","FieldDisplay","FieldEditor"],"mappings":"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"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { E as h, _ as x, B as V } from "./index-BCvBK2Fr.js";
|
|
2
|
+
import { ref as c, watch as p, openBlock as r, createElementBlock as _, toDisplayString as u, createBlock as v, reactive as b, unref as k, createSlots as E, withCtx as f, createElementVNode as m } from "vue";
|
|
3
|
+
import { ElInput as g } from "element-plus";
|
|
4
|
+
const B = { key: 0 }, F = {
|
|
5
|
+
__name: "FieldDisplay",
|
|
6
|
+
props: {
|
|
7
|
+
field: {
|
|
8
|
+
type: Object
|
|
9
|
+
},
|
|
10
|
+
row: {
|
|
11
|
+
type: Object
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
setup(t) {
|
|
15
|
+
const e = t, l = c(!1), a = c("...");
|
|
16
|
+
async function i() {
|
|
17
|
+
var d;
|
|
18
|
+
if ((d = e.field) != null && d.formatter) {
|
|
19
|
+
a.value = e.field.formatter(e.row), l.value = !a.value;
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
const o = e.field.code.toString().split(".").reduce((s, y) => s[y], e.row);
|
|
23
|
+
o == null || `${o}`.trim() === "" ? l.value = !0 : (a.value = o, l.value = !1);
|
|
24
|
+
}
|
|
25
|
+
return p(() => e.row, i, { immediate: !0 }), (n, o) => l.value ? (r(), v(h, { key: 1 })) : (r(), _("span", B, u(a.value), 1));
|
|
26
|
+
}
|
|
27
|
+
}, S = F, j = { class: "annotation" }, w = { class: "annotation" }, O = {
|
|
28
|
+
__name: "FieldEditor",
|
|
29
|
+
props: {
|
|
30
|
+
modelValue: [Object, String, Number],
|
|
31
|
+
field: Object,
|
|
32
|
+
type: String,
|
|
33
|
+
disabled: Boolean
|
|
34
|
+
},
|
|
35
|
+
emits: ["update:modelValue"],
|
|
36
|
+
setup(t, { emit: e }) {
|
|
37
|
+
const l = e, a = t, i = b({ value: a.modelValue });
|
|
38
|
+
function n() {
|
|
39
|
+
l("update:modelValue", i.value);
|
|
40
|
+
}
|
|
41
|
+
return p(
|
|
42
|
+
() => a.modelValue,
|
|
43
|
+
() => {
|
|
44
|
+
i.value = a.modelValue;
|
|
45
|
+
},
|
|
46
|
+
{ immediate: !0 }
|
|
47
|
+
), (o, d) => (r(), v(k(g), {
|
|
48
|
+
modelValue: i.value,
|
|
49
|
+
"onUpdate:modelValue": d[0] || (d[0] = (s) => i.value = s),
|
|
50
|
+
type: t.field.type,
|
|
51
|
+
clearable: "",
|
|
52
|
+
disabled: a.disabled,
|
|
53
|
+
placeholder: t.field.placeholder,
|
|
54
|
+
onInput: n
|
|
55
|
+
}, E({ _: 2 }, [
|
|
56
|
+
t.field.prefix ? {
|
|
57
|
+
name: "prefix",
|
|
58
|
+
fn: f(() => [
|
|
59
|
+
m("div", j, u(t.field.prefix), 1)
|
|
60
|
+
]),
|
|
61
|
+
key: "0"
|
|
62
|
+
} : void 0,
|
|
63
|
+
t.field.suffix ? {
|
|
64
|
+
name: "suffix",
|
|
65
|
+
fn: f(() => [
|
|
66
|
+
m("div", w, u(t.field.suffix), 1)
|
|
67
|
+
]),
|
|
68
|
+
key: "1"
|
|
69
|
+
} : void 0
|
|
70
|
+
]), 1032, ["modelValue", "type", "disabled", "placeholder"]));
|
|
71
|
+
}
|
|
72
|
+
}, D = /* @__PURE__ */ x(O, [["__scopeId", "data-v-449013dd"]]);
|
|
73
|
+
class C extends V {
|
|
74
|
+
constructor(e, l) {
|
|
75
|
+
super(e, l), this.display = S, this.editor = D, this.formatter = e.formatter, this.checkValidProperties(e);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
export {
|
|
79
|
+
C as default
|
|
80
|
+
};
|
|
81
|
+
//# sourceMappingURL=config-DpRuceEZ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config-DpRuceEZ.js","sources":["../src/framework/field/string/FieldDisplay.vue","../src/framework/field/string/FieldEditor.vue","../src/framework/field/string/config.js"],"sourcesContent":["<template>\r\n <span v-if=\"!isEmpty\"> {{ formattedValue }} </span>\r\n <EmptyTip v-else />\r\n</template>\r\n\r\n<script setup>\r\nimport EmptyTip from \"../../component/EmptyTip.vue\";\r\nimport { ref, watch } from \"vue\";\r\n\r\nconst props = defineProps({\r\n field: {\r\n type: Object,\r\n },\r\n row: {\r\n type: Object,\r\n },\r\n});\r\nconst isEmpty = ref(false);\r\nconst formattedValue = ref(\"...\");\r\n\r\nasync function getName() {\r\n if (props.field?.formatter) {\r\n formattedValue.value = props.field.formatter(props.row);\r\n isEmpty.value = !formattedValue.value;\r\n return;\r\n }\r\n const fields = props.field.code.toString().split(\".\");\r\n const value = fields.reduce((acc, curr) => acc[curr], props.row);\r\n\r\n if (value === undefined || value === null) {\r\n isEmpty.value = true;\r\n } else if (`${value}`.trim() === \"\") {\r\n isEmpty.value = true;\r\n } else {\r\n formattedValue.value = value;\r\n isEmpty.value = false;\r\n }\r\n}\r\n\r\nwatch(() => props.row, getName, { immediate: true });\r\n</script>\r\n\r\n<style scoped lang=\"scss\"></style>\r\n","<template>\r\n <el-input\r\n v-model=\"_form.value\"\r\n :type=\"field.type\"\r\n clearable\r\n :disabled=\"props.disabled\"\r\n :placeholder=\"field.placeholder\"\r\n @input=\"change\"\r\n >\r\n <template v-if=\"field.prefix\" #prefix>\r\n <div class=\"annotation\">{{ field.prefix }}</div>\r\n </template>\r\n <template v-if=\"field.suffix\" #suffix>\r\n <div class=\"annotation\">{{ field.suffix }}</div></template\r\n >\r\n </el-input>\r\n</template>\r\n\r\n<script setup>\r\nimport { ElInput } from \"element-plus\";\r\nimport { reactive, watch } from \"vue\";\r\n\r\nconst emit = defineEmits([\"update:modelValue\"]);\r\nconst props = defineProps({\r\n modelValue: [Object, String, Number],\r\n field: Object,\r\n type: String,\r\n disabled: Boolean,\r\n});\r\nconst _form = reactive({ value: props.modelValue });\r\n\r\nfunction change() {\r\n emit(\"update:modelValue\", _form.value);\r\n}\r\n\r\nwatch(\r\n () => props.modelValue,\r\n () => {\r\n _form.value = props.modelValue;\r\n },\r\n { immediate: true },\r\n);\r\n</script>\r\n\r\n<style scoped lang=\"scss\">\r\n.annotation {\r\n color: #606266;\r\n}\r\n</style>\r\n","import BaseFieldConfig from \"../base-field-config\";\r\nimport FieldDisplay from \"./FieldDisplay.vue\";\r\nimport FieldEditor from \"./FieldEditor.vue\";\r\n\r\nexport default class StringFieldConfig extends BaseFieldConfig {\r\n constructor(rawConfig, domain) {\r\n super(rawConfig, domain);\r\n this.display = FieldDisplay;\r\n this.editor = FieldEditor;\r\n this.formatter = rawConfig.formatter;\r\n\r\n this.checkValidProperties(rawConfig);\r\n }\r\n}\r\n"],"names":["props","__props","isEmpty","ref","formattedValue","getName","_a","value","acc","curr","watch","emit","__emit","_form","reactive","change","StringFieldConfig","BaseFieldConfig","rawConfig","domain","FieldDisplay","FieldEditor"],"mappings":";;;;;;;;;;;;;;AASA,UAAMA,IAAQC,GAQRC,IAAUC,EAAI,EAAK,GACnBC,IAAiBD,EAAI,KAAK;AAEhC,mBAAeE,IAAU;;AACvB,WAAIC,IAAAN,EAAM,UAAN,QAAAM,EAAa,WAAW;AAC1B,QAAAF,EAAe,QAAQJ,EAAM,MAAM,UAAUA,EAAM,GAAG,GACtDE,EAAQ,QAAQ,CAACE,EAAe;AAChC;AAAA,MACD;AAED,YAAMG,IADSP,EAAM,MAAM,KAAK,WAAW,MAAM,GAAG,EAC/B,OAAO,CAACQ,GAAKC,MAASD,EAAIC,CAAI,GAAGT,EAAM,GAAG;AAE/D,MAA2BO,KAAU,QAE1B,GAAGA,CAAK,GAAG,KAAI,MAAO,KAD/BL,EAAQ,QAAQ,MAIhBE,EAAe,QAAQG,GACvBL,EAAQ,QAAQ;AAAA,IAEpB;AAEA,WAAAQ,EAAM,MAAMV,EAAM,KAAKK,GAAS,EAAE,WAAW,GAAI,CAAE;;;;;;;;;;;;ACjBnD,UAAMM,IAAOC,GACPZ,IAAQC,GAMRY,IAAQC,EAAS,EAAE,OAAOd,EAAM,WAAY,CAAA;AAElD,aAASe,IAAS;AAChB,MAAAJ,EAAK,qBAAqBE,EAAM,KAAK;AAAA,IACvC;AAEA,WAAAH;AAAA,MACE,MAAMV,EAAM;AAAA,MACZ,MAAM;AACJ,QAAAa,EAAM,QAAQb,EAAM;AAAA,MACrB;AAAA,MACD,EAAE,WAAW,GAAM;AAAA,IACrB;;;;;;;;;;;;;;;;;;;;;;;;;;ACrCe,MAAMgB,UAA0BC,EAAgB;AAAA,EAC7D,YAAYC,GAAWC,GAAQ;AAC7B,UAAMD,GAAWC,CAAM,GACvB,KAAK,UAAUC,GACf,KAAK,SAASC,GACd,KAAK,YAAYH,EAAU,WAE3B,KAAK,qBAAqBA,CAAS;AAAA,EACpC;AACH;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { E as V, B as y } from "./index-
|
|
1
|
+
import { E as V, B as y } from "./index-BCvBK2Fr.js";
|
|
2
2
|
import { defineAsyncComponent as c, ref as m, watch as p, openBlock as i, createBlock as s, unref as f, reactive as b } from "vue";
|
|
3
3
|
const h = {
|
|
4
4
|
__name: "FieldDisplay",
|
|
@@ -73,4 +73,4 @@ class k extends y {
|
|
|
73
73
|
export {
|
|
74
74
|
k as default
|
|
75
75
|
};
|
|
76
|
-
//# sourceMappingURL=config-
|
|
76
|
+
//# sourceMappingURL=config-YJV5HV4J.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config-
|
|
1
|
+
{"version":3,"file":"config-YJV5HV4J.js","sources":["../src/framework/field/json/FieldDisplay.vue","../src/framework/field/json/FieldEditor.vue","../src/framework/field/json/config.js"],"sourcesContent":["<script setup>\r\nimport { defineAsyncComponent, ref, watch } from \"vue\";\r\nimport EmptyTip from \"../../component/EmptyTip.vue\";\r\n\r\nconst JsonEditorVue = defineAsyncComponent(() => {\r\n return import(\"json-editor-vue\");\r\n});\r\n\r\nconst props = defineProps({\r\n field: {\r\n type: Object,\r\n },\r\n row: {\r\n type: Object,\r\n },\r\n});\r\n\r\nconst valid = ref(false);\r\nconst formattedValue = ref(\"加载中...\");\r\n\r\nwatch(\r\n () => props.row,\r\n () => {\r\n valid.value = false;\r\n const value = props.row[props.field.code];\r\n if (value === undefined || value === null) {\r\n return;\r\n }\r\n\r\n if (`${value}`.trim() === \"\") {\r\n return;\r\n }\r\n\r\n valid.value = true;\r\n formattedValue.value = value;\r\n },\r\n { immediate: true },\r\n);\r\n</script>\r\n\r\n<template>\r\n <JsonEditorVue\r\n v-if=\"valid\"\r\n v-model=\"formattedValue\"\r\n mode=\"text\"\r\n :main-menu-bar=\"false\"\r\n :navigation-bar=\"false\"\r\n :read-only=\"true\"\r\n />\r\n <EmptyTip v-else />\r\n</template>\r\n\r\n<style scoped lang=\"scss\"></style>\r\n","<template>\r\n <JsonEditorVue\r\n v-model=\"_form.value\"\r\n style=\"width: 100%; height: 300px\"\r\n mode=\"text\"\r\n :main-menu-bar=\"false\"\r\n :navigation-bar=\"false\"\r\n @change=\"change\"\r\n />\r\n</template>\r\n\r\n<script setup>\r\nimport { reactive, watch, defineAsyncComponent } from \"vue\";\r\n\r\nconst JsonEditorVue = defineAsyncComponent(() => {\r\n return import(\"json-editor-vue\");\r\n});\r\n\r\nconst emit = defineEmits([\"update:modelValue\"]);\r\nconst props = defineProps({\r\n modelValue: Object,\r\n field: Object,\r\n disabled: Boolean,\r\n});\r\nconst _form = reactive({ value: props.modelValue });\r\n\r\nfunction change(value) {\r\n _form.value = value.text;\r\n emit(\"update:modelValue\", _form.value);\r\n}\r\n\r\nwatch(\r\n () => props.modelValue,\r\n () => {\r\n _form.value = props.modelValue;\r\n },\r\n { immediate: true },\r\n);\r\n</script>\r\n\r\n<style scoped lang=\"scss\"></style>\r\n","import BaseFieldConfig from \"../base-field-config\";\r\nimport FieldDisplay from \"./FieldDisplay.vue\";\r\nimport FieldEditor from \"./FieldEditor.vue\";\r\n\r\nexport default class JsonFieldConfig extends BaseFieldConfig {\r\n constructor(rawConfig, domain) {\r\n super(rawConfig, domain);\r\n this.display = FieldDisplay;\r\n this.editor = FieldEditor;\r\n\r\n this.checkValidProperties(rawConfig);\r\n }\r\n\r\n defaultConfig() {\r\n return {\r\n showInList: false,\r\n };\r\n }\r\n}\r\n"],"names":["JsonEditorVue","defineAsyncComponent","props","__props","valid","ref","formattedValue","watch","value","emit","__emit","_form","reactive","change","JsonFieldConfig","BaseFieldConfig","rawConfig","domain","FieldDisplay","FieldEditor"],"mappings":";;;;;;;;;;;;;AAIA,UAAMA,IAAgBC,EAAqB,MAClC,OAAO,iBAAiB,CAChC,GAEKC,IAAQC,GASRC,IAAQC,EAAI,EAAK,GACjBC,IAAiBD,EAAI,QAAQ;AAEnC,WAAAE;AAAA,MACE,MAAML,EAAM;AAAA,MACZ,MAAM;AACJ,QAAAE,EAAM,QAAQ;AACd,cAAMI,IAAQN,EAAM,IAAIA,EAAM,MAAM,IAAI;AACxC,QAA2BM,KAAU,QAIjC,GAAGA,CAAK,GAAG,KAAI,MAAO,OAI1BJ,EAAM,QAAQ,IACdE,EAAe,QAAQE;AAAA,MACxB;AAAA,MACD,EAAE,WAAW,GAAM;AAAA,IACrB;;;;;;;;;;;;;;;;;;;ACvBA,UAAMR,IAAgBC,EAAqB,MAClC,OAAO,iBAAiB,CAChC,GAEKQ,IAAOC,GACPR,IAAQC,GAKRQ,IAAQC,EAAS,EAAE,OAAOV,EAAM,WAAY,CAAA;AAElD,aAASW,EAAOL,GAAO;AACrB,MAAAG,EAAM,QAAQH,EAAM,MACpBC,EAAK,qBAAqBE,EAAM,KAAK;AAAA,IACvC;AAEA,WAAAJ;AAAA,MACE,MAAML,EAAM;AAAA,MACZ,MAAM;AACJ,QAAAS,EAAM,QAAQT,EAAM;AAAA,MACrB;AAAA,MACD,EAAE,WAAW,GAAM;AAAA,IACrB;;;;;;;;;;;ACjCe,MAAMY,UAAwBC,EAAgB;AAAA,EAC3D,YAAYC,GAAWC,GAAQ;AAC7B,UAAMD,GAAWC,CAAM,GACvB,KAAK,UAAUC,GACf,KAAK,SAASC,GAEd,KAAK,qBAAqBH,CAAS;AAAA,EACpC;AAAA,EAED,gBAAgB;AACd,WAAO;AAAA,MACL,YAAY;AAAA,IAClB;AAAA,EACG;AACH;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as u, B as p } from "./index-
|
|
1
|
+
import { _ as u, B as p } from "./index-BCvBK2Fr.js";
|
|
2
2
|
import { openBlock as r, createElementBlock as a, createElementVNode as m, defineAsyncComponent as _, reactive as f, watch as d, createVNode as h, unref as v } from "vue";
|
|
3
3
|
const V = { class: "editor-field" }, y = ["innerHTML"], b = {
|
|
4
4
|
__name: "FieldDisplay",
|
|
@@ -28,7 +28,7 @@ const V = { class: "editor-field" }, y = ["innerHTML"], b = {
|
|
|
28
28
|
},
|
|
29
29
|
emits: ["update:modelValue"],
|
|
30
30
|
setup(o, { emit: e }) {
|
|
31
|
-
const i = _(() => import("./RichTextEditor-
|
|
31
|
+
const i = _(() => import("./RichTextEditor-Y889dJnt.js")), s = e, n = o, t = f({ value: n.modelValue });
|
|
32
32
|
return d(
|
|
33
33
|
() => t.value,
|
|
34
34
|
() => {
|
|
@@ -62,4 +62,4 @@ class k extends p {
|
|
|
62
62
|
export {
|
|
63
63
|
k as default
|
|
64
64
|
};
|
|
65
|
-
//# sourceMappingURL=config-
|
|
65
|
+
//# sourceMappingURL=config-enmhhwQ8.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config-
|
|
1
|
+
{"version":3,"file":"config-enmhhwQ8.js","sources":["../src/framework/field/rich-text/FieldDisplay.vue","../src/framework/field/rich-text/FieldEditor.vue","../src/framework/field/rich-text/config.js"],"sourcesContent":["<script setup>\r\nconst props = defineProps({\r\n field: {\r\n type: Object,\r\n },\r\n row: {\r\n type: Object,\r\n },\r\n});\r\n</script>\r\n\r\n<template>\r\n <div class=\"editor-field\">\r\n <div class=\"content\" v-html=\"props.row[props.field.code]\" />\r\n </div>\r\n</template>\r\n\r\n<style scoped lang=\"scss\">\r\n.editor-field {\r\n width: 100%;\r\n background: #999;\r\n padding: 20px 0;\r\n\r\n .content {\r\n word-wrap: break-word;\r\n font-family: \"Helvetica Neue,Helvetica,PingFang SC,Hiragino Sans GB,Microsoft YaHei,微软雅黑,Arial,sans-serif\" !important;\r\n max-width: 500px;\r\n padding: 20px;\r\n margin: 0 auto;\r\n background: white;\r\n white-space: break-spaces;\r\n :deep(img) {\r\n width: 100%;\r\n max-width: 100%;\r\n }\r\n }\r\n}\r\n</style>\r\n","<template>\r\n <div style=\"width: 100%\">\r\n <RichTextEditor v-model:content=\"_form.value\" :field=\"props.field\" />\r\n </div>\r\n</template>\r\n\r\n<script setup>\r\nimport { reactive, watch, defineAsyncComponent, defineEmits } from \"vue\";\r\n\r\nconst RichTextEditor = defineAsyncComponent(() => {\r\n return import(\"./RichTextEditor.vue\");\r\n});\r\n\r\nconst emit = defineEmits([\"update:modelValue\"]);\r\nconst props = defineProps({\r\n modelValue: String,\r\n field: Object,\r\n disabled: Boolean,\r\n});\r\nconst _form = reactive({ value: props.modelValue });\r\n\r\nwatch(\r\n () => _form.value,\r\n () => {\r\n emit(\"update:modelValue\", _form.value);\r\n },\r\n);\r\nwatch(\r\n () => props.modelValue,\r\n async () => {\r\n _form.value = props.modelValue;\r\n },\r\n { immediate: true },\r\n);\r\n</script>\r\n\r\n<style scoped lang=\"scss\"></style>\r\n","import BaseFieldConfig from \"../base-field-config\";\r\nimport FieldDisplay from \"./FieldDisplay.vue\";\r\nimport FieldEditor from \"./FieldEditor.vue\";\r\n\r\nexport default class EditorFieldConfig extends BaseFieldConfig {\r\n constructor(rawConfig, domain) {\r\n super(rawConfig, domain);\r\n this.display = FieldDisplay;\r\n this.editor = FieldEditor;\r\n\r\n this.checkValidProperties(rawConfig);\r\n }\r\n\r\n defaultConfig() {\r\n return {\r\n showInList: false,\r\n };\r\n }\r\n}\r\n"],"names":["props","__props","RichTextEditor","defineAsyncComponent","emit","__emit","_form","reactive","watch","EditorFieldConfig","BaseFieldConfig","rawConfig","domain","FieldDisplay","FieldEditor"],"mappings":";;;;;;;;;;;;;AACA,UAAMA,IAAQC;;;;;;;;;;;;;;;;;ACQd,UAAMC,IAAiBC,EAAqB,MACnC,OAAO,8BAAsB,CACrC,GAEKC,IAAOC,GACPL,IAAQC,GAKRK,IAAQC,EAAS,EAAE,OAAOP,EAAM,WAAY,CAAA;AAElD,WAAAQ;AAAA,MACE,MAAMF,EAAM;AAAA,MACZ,MAAM;AACJ,QAAAF,EAAK,qBAAqBE,EAAM,KAAK;AAAA,MACtC;AAAA,IACH,GACAE;AAAA,MACE,MAAMR,EAAM;AAAA,MACZ,YAAY;AACV,QAAAM,EAAM,QAAQN,EAAM;AAAA,MACrB;AAAA,MACD,EAAE,WAAW,GAAM;AAAA,IACrB;;;;;;;;;AC7Be,MAAMS,UAA0BC,EAAgB;AAAA,EAC7D,YAAYC,GAAWC,GAAQ;AAC7B,UAAMD,GAAWC,CAAM,GACvB,KAAK,UAAUC,GACf,KAAK,SAASC,GAEd,KAAK,qBAAqBH,CAAS;AAAA,EACpC;AAAA,EAED,gBAAgB;AACd,WAAO;AAAA,MACL,YAAY;AAAA,IAClB;AAAA,EACG;AACH;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { e as f, f as _, q as h, B as V } from "./index-
|
|
1
|
+
import { e as f, f as _, q as h, B as V } from "./index-BCvBK2Fr.js";
|
|
2
2
|
import { computed as y, openBlock as s, createElementBlock as v, createBlock as i, unref as l, withCtx as c, createVNode as u, reactive as b, watch as B } from "vue";
|
|
3
3
|
import { ElIcon as r, ElSwitch as k } from "element-plus";
|
|
4
4
|
import "./el-switch-l0sNRNKZ.js";
|
|
@@ -81,4 +81,4 @@ class D extends V {
|
|
|
81
81
|
export {
|
|
82
82
|
D as default
|
|
83
83
|
};
|
|
84
|
-
//# sourceMappingURL=config-
|
|
84
|
+
//# sourceMappingURL=config-v-QQU1RL.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config-
|
|
1
|
+
{"version":3,"file":"config-v-QQU1RL.js","sources":["../src/framework/field/boolean/FieldDisplay.vue","../src/framework/field/boolean/FieldEditor.vue","../src/framework/field/boolean/config.js"],"sourcesContent":["<template>\r\n <span style=\"display: flex; align-items: center\">\r\n <el-icon v-if=\"value == true\" color=\"#529b2e\" :size=\"20\">\r\n <SuccessFilled />\r\n </el-icon>\r\n <el-icon v-else-if=\"value == false\" color=\"#F56C6C\" :size=\"20\">\r\n <CircleCloseFilled />\r\n </el-icon>\r\n <el-icon v-else color=\"#73767a\" :size=\"20\">\r\n <QuestionFilled />\r\n </el-icon>\r\n </span>\r\n</template>\r\n\r\n<script setup>\r\nimport { ElIcon } from \"element-plus\";\r\nimport { computed } from \"vue\";\r\nimport {\r\n SuccessFilled,\r\n CircleCloseFilled,\r\n QuestionFilled,\r\n} from \"@element-plus/icons-vue\";\r\n\r\nconst props = defineProps({\r\n field: {\r\n type: Object,\r\n },\r\n row: {\r\n type: Object,\r\n },\r\n});\r\n\r\nconst value = computed(() => {\r\n return props.row[props.field.code];\r\n});\r\n</script>\r\n\r\n<style scoped lang=\"scss\"></style>\r\n","<template>\r\n <el-switch\r\n v-model=\"_form.value\"\r\n :disabled=\"props.disabled\"\r\n @change=\"change\"\r\n />\r\n</template>\r\n\r\n<script setup>\r\nimport { ElSwitch } from \"element-plus\";\r\nimport { reactive, watch } from \"vue\";\r\n\r\nconst emit = defineEmits([\"update:modelValue\"]);\r\nconst props = defineProps({\r\n modelValue: Boolean,\r\n field: Object,\r\n disabled: Boolean,\r\n});\r\nconst _form = reactive({ value: props.modelValue });\r\n\r\nfunction change() {\r\n emit(\"update:modelValue\", _form.value);\r\n}\r\n\r\nwatch(\r\n () => props.modelValue,\r\n () => {\r\n _form.value = props.modelValue;\r\n },\r\n { immediate: true },\r\n);\r\n</script>\r\n\r\n<style scoped lang=\"scss\"></style>\r\n","import BaseFieldConfig from \"../base-field-config\";\r\nimport FieldDisplay from \"./FieldDisplay.vue\";\r\nimport FieldEditor from \"./FieldEditor.vue\";\r\n\r\nexport default class BooleanFieldConfig extends BaseFieldConfig {\r\n constructor(rawConfig, domain) {\r\n super(rawConfig, domain);\r\n this.default = rawConfig.default || false;\r\n this.display = FieldDisplay;\r\n this.editor = FieldEditor;\r\n this.formChange = rawConfig.formChange || (() => {});\r\n\r\n this.checkValidProperties(rawConfig);\r\n }\r\n}\r\n"],"names":["props","__props","value","computed","emit","__emit","_form","reactive","change","watch","BooleanFieldConfig","BaseFieldConfig","rawConfig","domain","FieldDisplay","FieldEditor"],"mappings":";;;;;;;;;;;;;;;AAuBA,UAAMA,IAAQC,GASRC,IAAQC,EAAS,MACdH,EAAM,IAAIA,EAAM,MAAM,IAAI,CAClC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACtBD,UAAMI,IAAOC,GACPL,IAAQC,GAKRK,IAAQC,EAAS,EAAE,OAAOP,EAAM,WAAY,CAAA;AAElD,aAASQ,IAAS;AAChB,MAAAJ,EAAK,qBAAqBE,EAAM,KAAK;AAAA,IACvC;AAEA,WAAAG;AAAA,MACE,MAAMT,EAAM;AAAA,MACZ,MAAM;AACJ,QAAAM,EAAM,QAAQN,EAAM;AAAA,MACrB;AAAA,MACD,EAAE,WAAW,GAAM;AAAA,IACrB;;;;;;;;AC1Be,MAAMU,UAA2BC,EAAgB;AAAA,EAC9D,YAAYC,GAAWC,GAAQ;AAC7B,UAAMD,GAAWC,CAAM,GACvB,KAAK,UAAUD,EAAU,WAAW,IACpC,KAAK,UAAUE,GACf,KAAK,SAASC,GACd,KAAK,aAAaH,EAAU,eAAe,MAAM;AAAA,IAAE,IAEnD,KAAK,qBAAqBA,CAAS;AAAA,EACpC;AACH;"}
|