@vipl520/dk-ui 1.0.76 → 1.0.77
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/attributes.json +8 -0
- package/dist/index.css +1 -1
- package/dist/index.js +285 -12
- package/dist/index.min.js +5 -5
- package/dist/index.min.js.map +1 -1
- package/dist/index.min.mjs +5 -5
- package/dist/index.min.mjs.map +1 -1
- package/dist/index.mjs +282 -11
- package/dist/tags.json +7 -0
- package/dist/web-types.json +34 -0
- package/es/index.d.ts +1 -0
- package/es/index.mjs +4 -1
- package/es/index.mjs.map +1 -1
- package/es/index.scss +1 -0
- package/es/style-custom-input/style/index.scss +0 -1
- package/es/table-form/index.d.ts +53 -0
- package/es/table-form/index.mjs +8 -0
- package/es/table-form/index.mjs.map +1 -0
- package/es/table-form/src/props.d.ts +23 -0
- package/es/table-form/src/props.mjs +26 -0
- package/es/table-form/src/props.mjs.map +1 -0
- package/es/table-form/src/table-form.vue.d.ts +52 -0
- package/es/table-form/src/table-form.vue.mjs +7 -0
- package/es/table-form/src/table-form.vue.mjs.map +1 -0
- package/es/table-form/src/table-form.vue2.mjs +250 -0
- package/es/table-form/src/table-form.vue2.mjs.map +1 -0
- package/es/table-form/style/index.css +1 -0
- package/es/table-form/style/index.scss +110 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +187 -182
- package/lib/index.js.map +1 -1
- package/lib/index.scss +1 -0
- package/lib/style-custom-input/style/index.scss +0 -1
- package/lib/table-form/index.d.ts +53 -0
- package/lib/table-form/index.js +14 -0
- package/lib/table-form/index.js.map +1 -0
- package/lib/table-form/src/props.d.ts +23 -0
- package/lib/table-form/src/props.js +28 -0
- package/lib/table-form/src/props.js.map +1 -0
- package/lib/table-form/src/table-form.vue.d.ts +52 -0
- package/lib/table-form/src/table-form.vue.js +11 -0
- package/lib/table-form/src/table-form.vue.js.map +1 -0
- package/lib/table-form/src/table-form.vue2.js +254 -0
- package/lib/table-form/src/table-form.vue2.js.map +1 -0
- package/lib/table-form/style/index.css +1 -0
- package/lib/table-form/style/index.scss +110 -0
- package/package.json +1 -1
@@ -0,0 +1,52 @@
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{
|
2
|
+
formCreateInject: ObjectConstructor;
|
3
|
+
modelValue: {
|
4
|
+
type: ArrayConstructor;
|
5
|
+
default: () => never[];
|
6
|
+
};
|
7
|
+
columns: {
|
8
|
+
type: ArrayConstructor;
|
9
|
+
required: boolean;
|
10
|
+
default: () => never[];
|
11
|
+
};
|
12
|
+
options: {
|
13
|
+
type: ObjectConstructor;
|
14
|
+
default: () => {
|
15
|
+
submitBtn: boolean;
|
16
|
+
resetBtn: boolean;
|
17
|
+
};
|
18
|
+
};
|
19
|
+
max: NumberConstructor;
|
20
|
+
disabled: BooleanConstructor;
|
21
|
+
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "change" | "delete" | "add")[], "update:modelValue" | "change" | "delete" | "add", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
22
|
+
formCreateInject: ObjectConstructor;
|
23
|
+
modelValue: {
|
24
|
+
type: ArrayConstructor;
|
25
|
+
default: () => never[];
|
26
|
+
};
|
27
|
+
columns: {
|
28
|
+
type: ArrayConstructor;
|
29
|
+
required: boolean;
|
30
|
+
default: () => never[];
|
31
|
+
};
|
32
|
+
options: {
|
33
|
+
type: ObjectConstructor;
|
34
|
+
default: () => {
|
35
|
+
submitBtn: boolean;
|
36
|
+
resetBtn: boolean;
|
37
|
+
};
|
38
|
+
};
|
39
|
+
max: NumberConstructor;
|
40
|
+
disabled: BooleanConstructor;
|
41
|
+
}>> & {
|
42
|
+
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
43
|
+
onChange?: ((...args: any[]) => any) | undefined;
|
44
|
+
onDelete?: ((...args: any[]) => any) | undefined;
|
45
|
+
onAdd?: ((...args: any[]) => any) | undefined;
|
46
|
+
}, {
|
47
|
+
modelValue: unknown[];
|
48
|
+
disabled: boolean;
|
49
|
+
options: Record<string, any>;
|
50
|
+
columns: unknown[];
|
51
|
+
}, {}>;
|
52
|
+
export default _default;
|
@@ -0,0 +1,7 @@
|
|
1
|
+
import _sfc_main from './table-form.vue2.mjs';
|
2
|
+
import _export_sfc from '../../_virtual/_plugin-vue_export-helper.mjs';
|
3
|
+
|
4
|
+
var _TableForm = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "E:\\project\\monster-admin\\system\\dkgs-ui-back\\packages\\dk-ui\\src\\table-form\\src\\table-form.vue"]]);
|
5
|
+
|
6
|
+
export { _TableForm as default };
|
7
|
+
//# sourceMappingURL=table-form.vue.mjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"table-form.vue.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
|
@@ -0,0 +1,250 @@
|
|
1
|
+
import { defineComponent, ref, markRaw, watch, onMounted, resolveComponent, openBlock, createElementBlock, normalizeClass, createBlock, resolveDynamicComponent, unref, withCtx, createElementVNode, createVNode, createTextVNode, createCommentVNode } from 'vue';
|
2
|
+
import formCreate from '@form-create/element-ui';
|
3
|
+
import { tableFormProps } from './props.mjs';
|
4
|
+
|
5
|
+
const __default__ = defineComponent({
|
6
|
+
name: "DkTableForm"
|
7
|
+
});
|
8
|
+
var _sfc_main = /* @__PURE__ */ defineComponent({
|
9
|
+
...__default__,
|
10
|
+
props: tableFormProps,
|
11
|
+
emits: ["change", "add", "delete", "update:modelValue"],
|
12
|
+
setup(__props, { emit }) {
|
13
|
+
const props = __props;
|
14
|
+
const rule = ref([]);
|
15
|
+
const trs = ref([]);
|
16
|
+
const fapi = ref({});
|
17
|
+
const Form = markRaw(props.formCreateInject?.form?.$form() || {});
|
18
|
+
const copyTrs = ref("");
|
19
|
+
const oldValue = ref("");
|
20
|
+
const formChange = (field, _, rule2, api, flag) => {
|
21
|
+
if (!flag) {
|
22
|
+
updateValue();
|
23
|
+
}
|
24
|
+
};
|
25
|
+
const updateValue = () => {
|
26
|
+
const value = trs.value.map((tr, idx) => ({
|
27
|
+
// Vue: Spread types may only be created from object types.
|
28
|
+
...props.modelValue[idx] || {},
|
29
|
+
...fapi.value.getChildrenFormData(tr)
|
30
|
+
})).filter((v) => {
|
31
|
+
if (v === void 0 || v === null) {
|
32
|
+
return false;
|
33
|
+
}
|
34
|
+
let flag = false;
|
35
|
+
Object.keys(v).forEach((k) => {
|
36
|
+
flag = flag || v[k] !== void 0 && v[k] !== "" && v[k] !== null;
|
37
|
+
});
|
38
|
+
return flag;
|
39
|
+
});
|
40
|
+
const str = JSON.stringify(value);
|
41
|
+
if (str !== oldValue.value) {
|
42
|
+
oldValue.value = str;
|
43
|
+
emit("update:modelValue", value);
|
44
|
+
emit("change", value);
|
45
|
+
}
|
46
|
+
};
|
47
|
+
const setRawData = (idx, formData) => {
|
48
|
+
const raw = trs.value[idx];
|
49
|
+
fapi.value.setChildrenFormData(raw, formData, true);
|
50
|
+
};
|
51
|
+
const updateTable = () => {
|
52
|
+
const str = JSON.stringify(props.modelValue);
|
53
|
+
if (oldValue.value === str) {
|
54
|
+
return;
|
55
|
+
}
|
56
|
+
oldValue.value = str;
|
57
|
+
trs.value.splice(0, trs.value.length, ...props.modelValue.map(() => null));
|
58
|
+
if (!props.modelValue.length) {
|
59
|
+
addRaw();
|
60
|
+
}
|
61
|
+
props.modelValue.forEach((data, idx) => {
|
62
|
+
if (!trs.value[idx]) {
|
63
|
+
addRaw();
|
64
|
+
}
|
65
|
+
setRawData(idx, data);
|
66
|
+
});
|
67
|
+
rule.value[0].children[1].children = trs.value;
|
68
|
+
};
|
69
|
+
const delRaw = (idx) => {
|
70
|
+
if (props.disabled) {
|
71
|
+
return;
|
72
|
+
}
|
73
|
+
trs.value.splice(idx, 1);
|
74
|
+
updateValue();
|
75
|
+
if (trs.value.length) {
|
76
|
+
trs.value.forEach(updateRaw);
|
77
|
+
} else {
|
78
|
+
addRaw();
|
79
|
+
}
|
80
|
+
emit("delete", idx);
|
81
|
+
};
|
82
|
+
const addRaw = (flag = false) => {
|
83
|
+
if (flag && props.disabled) {
|
84
|
+
return;
|
85
|
+
}
|
86
|
+
const tr = formCreate.parseJson(copyTrs.value)[0];
|
87
|
+
trs.value.push(tr);
|
88
|
+
updateRaw(tr);
|
89
|
+
if (flag)
|
90
|
+
emit("add", trs.value.length);
|
91
|
+
};
|
92
|
+
const updateRaw = (tr) => {
|
93
|
+
const idx = trs.value.indexOf(tr);
|
94
|
+
tr.children[0].props.innerText = idx + 1;
|
95
|
+
tr.children[tr.children.length - 1].children[0].props.onClick = () => {
|
96
|
+
delRaw(idx);
|
97
|
+
};
|
98
|
+
};
|
99
|
+
const loadRule = () => {
|
100
|
+
const header = [
|
101
|
+
{
|
102
|
+
type: "th",
|
103
|
+
native: true,
|
104
|
+
class: "dk-tf-head-idx",
|
105
|
+
props: {
|
106
|
+
innerText: "#"
|
107
|
+
}
|
108
|
+
}
|
109
|
+
];
|
110
|
+
const body = [
|
111
|
+
{
|
112
|
+
type: "td",
|
113
|
+
class: "dk-tf-idx",
|
114
|
+
native: true,
|
115
|
+
props: {
|
116
|
+
innerText: "0"
|
117
|
+
}
|
118
|
+
}
|
119
|
+
];
|
120
|
+
props.columns.forEach((column) => {
|
121
|
+
header.push({
|
122
|
+
type: "th",
|
123
|
+
native: true,
|
124
|
+
style: column.style,
|
125
|
+
props: {
|
126
|
+
innerText: column.label || ""
|
127
|
+
}
|
128
|
+
});
|
129
|
+
body.push({
|
130
|
+
type: "td",
|
131
|
+
native: true,
|
132
|
+
children: [...column.rule || []]
|
133
|
+
});
|
134
|
+
});
|
135
|
+
header.push({
|
136
|
+
type: "th",
|
137
|
+
native: true,
|
138
|
+
class: "dk-tf-edit fc-clock",
|
139
|
+
props: {
|
140
|
+
innerText: "\u64CD\u4F5C"
|
141
|
+
}
|
142
|
+
});
|
143
|
+
body.push({
|
144
|
+
type: "td",
|
145
|
+
native: true,
|
146
|
+
class: "dk-tf-btn fc-clock",
|
147
|
+
children: [
|
148
|
+
{
|
149
|
+
type: "dk-icon",
|
150
|
+
native: true,
|
151
|
+
class: "fc-icon icon-delete",
|
152
|
+
props: {
|
153
|
+
icon: "DeleteFilled"
|
154
|
+
}
|
155
|
+
}
|
156
|
+
]
|
157
|
+
});
|
158
|
+
copyTrs.value = formCreate.toJson([
|
159
|
+
{
|
160
|
+
type: "tr",
|
161
|
+
native: true,
|
162
|
+
subRule: true,
|
163
|
+
children: body
|
164
|
+
}
|
165
|
+
]);
|
166
|
+
rule.value = [
|
167
|
+
{
|
168
|
+
type: "table",
|
169
|
+
native: true,
|
170
|
+
class: "dk-tf-table",
|
171
|
+
props: {
|
172
|
+
border: "1",
|
173
|
+
cellspacing: "0",
|
174
|
+
cellpadding: "0"
|
175
|
+
},
|
176
|
+
children: [
|
177
|
+
{
|
178
|
+
type: "thead",
|
179
|
+
native: true,
|
180
|
+
children: [
|
181
|
+
{
|
182
|
+
type: "tr",
|
183
|
+
native: true,
|
184
|
+
children: header
|
185
|
+
}
|
186
|
+
]
|
187
|
+
},
|
188
|
+
{
|
189
|
+
type: "tbody",
|
190
|
+
native: true,
|
191
|
+
children: trs.value
|
192
|
+
}
|
193
|
+
]
|
194
|
+
}
|
195
|
+
];
|
196
|
+
addRaw();
|
197
|
+
};
|
198
|
+
watch(() => props.modelValue, updateTable, { deep: true });
|
199
|
+
onMounted(() => {
|
200
|
+
loadRule();
|
201
|
+
updateTable();
|
202
|
+
});
|
203
|
+
return (_ctx, _cache) => {
|
204
|
+
const _component_dk_icon = resolveComponent("dk-icon");
|
205
|
+
const _component_el_button = resolveComponent("el-button");
|
206
|
+
return openBlock(), createElementBlock(
|
207
|
+
"div",
|
208
|
+
{
|
209
|
+
class: normalizeClass(["dk-table-form", { "dk-disabled": _ctx.disabled }])
|
210
|
+
},
|
211
|
+
[
|
212
|
+
(openBlock(), createBlock(resolveDynamicComponent(unref(Form)), {
|
213
|
+
api: fapi.value,
|
214
|
+
"onUpdate:api": _cache[0] || (_cache[0] = ($event) => fapi.value = $event),
|
215
|
+
option: _ctx.options,
|
216
|
+
rule: rule.value,
|
217
|
+
"extend-option": true,
|
218
|
+
disabled: _ctx.disabled,
|
219
|
+
onChange: formChange,
|
220
|
+
onEmitEvent: _ctx.$emit
|
221
|
+
}, null, 40, ["api", "option", "rule", "disabled", "onEmitEvent"])),
|
222
|
+
!_ctx.max || _ctx.max > trs.value.length ? (openBlock(), createBlock(_component_el_button, {
|
223
|
+
key: 0,
|
224
|
+
link: "",
|
225
|
+
type: "primary",
|
226
|
+
class: "fc-clock",
|
227
|
+
onClick: _cache[1] || (_cache[1] = ($event) => addRaw(true))
|
228
|
+
}, {
|
229
|
+
default: withCtx(() => [
|
230
|
+
createElementVNode("span", null, [
|
231
|
+
createVNode(_component_dk_icon, {
|
232
|
+
icon: "CirclePlusFilled",
|
233
|
+
size: 14
|
234
|
+
}),
|
235
|
+
createTextVNode(" \u6DFB\u52A0")
|
236
|
+
])
|
237
|
+
]),
|
238
|
+
_: 1
|
239
|
+
/* STABLE */
|
240
|
+
})) : createCommentVNode("v-if", true)
|
241
|
+
],
|
242
|
+
2
|
243
|
+
/* CLASS */
|
244
|
+
);
|
245
|
+
};
|
246
|
+
}
|
247
|
+
});
|
248
|
+
|
249
|
+
export { _sfc_main as default };
|
250
|
+
//# sourceMappingURL=table-form.vue2.mjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"table-form.vue2.mjs","sources":["../../../src/table-form/src/table-form.vue"],"sourcesContent":["<script lang=\"ts\">\nimport { defineComponent as __MACROS_defineComponent } from \"vue\";\nexport default /*#__PURE__*/ __MACROS_defineComponent({\n name: 'DkTableForm',\n});\n</script>\n<template>\n <div class=\"dk-table-form\" :class=\"{ 'dk-disabled': disabled }\">\n <component\n :is=\"Form\"\n v-model:api=\"fapi\"\n :option=\"options\"\n :rule=\"rule\"\n :extend-option=\"true\"\n :disabled=\"disabled\"\n @change=\"formChange\"\n @emit-event=\"$emit\"\n ></component>\n <el-button v-if=\"!max || max > trs.length\" link type=\"primary\" class=\"fc-clock\" @click=\"addRaw(true)\">\n <span> <dk-icon icon=\"CirclePlusFilled\" :size=\"14\"></dk-icon> 添加</span>\n </el-button>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { ref, watch, onMounted, markRaw } from 'vue'\nimport formCreate from '@form-create/element-ui' // 根据实际情况调整导入路径\nimport { tableFormProps } from './props'\n\n\n\nconst props = defineProps(tableFormProps)\n\n// 定义事件发射器\nconst emit = defineEmits(['change', 'add', 'delete', 'update:modelValue'])\n\n// 初始化数据\nconst rule: any = ref([])\n// const trs = ref([])\nconst trs = ref<((typeof props.modelValue)[number] | null)[]>([])\nconst fapi: any = ref({})\nconst Form = markRaw(props.formCreateInject?.form?.$form() || {})\nconst copyTrs = ref('')\nconst oldValue = ref('')\n\n// 方法定义\nconst formChange = (field: any, _: any, rule: any, api: any, flag: boolean) => {\n if (!flag) {\n updateValue()\n }\n}\n\nconst updateValue = () => {\n const value = trs.value\n .map((tr: any, idx: number) => ({\n // Vue: Spread types may only be created from object types.\n ...((props.modelValue[idx] as Record<string, any>) || {}),\n ...fapi.value.getChildrenFormData(tr),\n }))\n .filter((v) => {\n if (v === undefined || v === null) {\n return false\n }\n let flag = false\n Object.keys(v).forEach((k) => {\n flag = flag || (v[k] !== undefined && v[k] !== '' && v[k] !== null)\n })\n return flag\n })\n\n const str = JSON.stringify(value)\n if (str !== oldValue.value) {\n oldValue.value = str\n emit('update:modelValue', value)\n emit('change', value)\n }\n}\n\nconst setRawData = (idx: number, formData: any) => {\n const raw = trs.value[idx]\n fapi.value.setChildrenFormData(raw, formData, true)\n}\n\nconst updateTable = () => {\n const str = JSON.stringify(props.modelValue)\n // 定义 trs 的类型为 modelValue 中元素的类型或 null\n if (oldValue.value === str) {\n return\n }\n oldValue.value = str\n // trs.value.splice(0, trs.value.length, ...props.modelValue.map(() => null))\n trs.value.splice(0, trs.value.length, ...props.modelValue.map(() => null as any))\n if (!props.modelValue.length) {\n addRaw()\n }\n props.modelValue.forEach((data: any, idx: number) => {\n if (!trs.value[idx]) {\n addRaw()\n }\n setRawData(idx, data)\n })\n rule.value[0].children[1].children = trs.value\n}\n\nconst delRaw = (idx: number) => {\n if (props.disabled) {\n return\n }\n trs.value.splice(idx, 1)\n updateValue()\n if (trs.value.length) {\n trs.value.forEach(updateRaw)\n } else {\n addRaw()\n }\n emit('delete', idx)\n}\n\nconst addRaw = (flag: boolean = false) => {\n if (flag && props.disabled) {\n return\n }\n const tr = formCreate.parseJson(copyTrs.value)[0]\n trs.value.push(tr)\n updateRaw(tr)\n if (flag) emit('add', trs.value.length)\n}\n\nconst updateRaw = (tr: any) => {\n const idx = trs.value.indexOf(tr)\n tr.children[0].props.innerText = idx + 1\n tr.children[tr.children.length - 1].children[0].props.onClick = () => {\n delRaw(idx)\n }\n}\n\nconst loadRule = () => {\n const header: any = [\n {\n type: 'th',\n native: true,\n class: 'dk-tf-head-idx',\n props: {\n innerText: '#',\n },\n },\n ]\n const body: any = [\n {\n type: 'td',\n class: 'dk-tf-idx',\n native: true,\n props: {\n innerText: '0',\n },\n },\n ]\n\n props.columns.forEach((column: any) => {\n header.push({\n type: 'th',\n native: true,\n style: column.style,\n props: {\n innerText: column.label || '',\n },\n })\n body.push({\n type: 'td',\n native: true,\n children: [...(column.rule || [])],\n })\n })\n\n header.push({\n type: 'th',\n native: true,\n class: 'dk-tf-edit fc-clock',\n props: {\n innerText: '操作',\n },\n })\n\n body.push({\n type: 'td',\n native: true,\n class: 'dk-tf-btn fc-clock',\n children: [\n {\n type: 'dk-icon',\n native: true,\n class: 'fc-icon icon-delete',\n props: {\n icon: 'DeleteFilled',\n },\n },\n ],\n })\n\n copyTrs.value = formCreate.toJson([\n {\n type: 'tr',\n native: true,\n subRule: true,\n children: body,\n },\n ])\n\n rule.value = [\n {\n type: 'table',\n native: true,\n class: 'dk-tf-table',\n props: {\n border: '1',\n cellspacing: '0',\n cellpadding: '0',\n },\n children: [\n {\n type: 'thead',\n native: true,\n children: [\n {\n type: 'tr',\n native: true,\n children: header,\n },\n ],\n },\n {\n type: 'tbody',\n native: true,\n children: trs.value,\n },\n ],\n },\n ]\n\n addRaw()\n}\n\n// 监听和生命周期钩子\nwatch(() => props.modelValue, updateTable, { deep: true })\n\nonMounted(() => {\n loadRule()\n updateTable()\n})\n</script>\n"],"names":["__MACROS_defineComponent","rule"],"mappings":";;;;AAEA,MAA6B,cAAAA,eAAyB,CAAA;AAAA,EACpD,IAAM,EAAA,aAAA;AACR,CAAC,CAAA,CAAA;;;;;;;AAiCD,IAAM,MAAA,IAAA,GAAY,GAAI,CAAA,EAAE,CAAA,CAAA;AAExB,IAAM,MAAA,GAAA,GAAM,GAAkD,CAAA,EAAE,CAAA,CAAA;AAChE,IAAM,MAAA,IAAA,GAAY,GAAI,CAAA,EAAE,CAAA,CAAA;AACxB,IAAM,MAAA,IAAA,GAAO,QAAQ,KAAM,CAAA,gBAAA,EAAkB,MAAM,KAAM,EAAA,IAAK,EAAE,CAAA,CAAA;AAChE,IAAM,MAAA,OAAA,GAAU,IAAI,EAAE,CAAA,CAAA;AACtB,IAAM,MAAA,QAAA,GAAW,IAAI,EAAE,CAAA,CAAA;AAGvB,IAAA,MAAM,aAAa,CAAC,KAAA,EAAY,CAAQC,EAAAA,KAAAA,EAAW,KAAU,IAAkB,KAAA;AAC7E,MAAA,IAAI,CAAC,IAAM,EAAA;AACT,QAAY,WAAA,EAAA,CAAA;AAAA,OACd;AAAA,KACF,CAAA;AAEA,IAAA,MAAM,cAAc,MAAM;AACxB,MAAA,MAAM,QAAQ,GAAI,CAAA,KAAA,CACf,GAAI,CAAA,CAAC,IAAS,GAAiB,MAAA;AAAA;AAAA,QAE9B,GAAK,KAAA,CAAM,UAAW,CAAA,GAAG,KAA6B,EAAC;AAAA,QACvD,GAAG,IAAA,CAAK,KAAM,CAAA,mBAAA,CAAoB,EAAE,CAAA;AAAA,OACpC,CAAA,CAAA,CACD,MAAO,CAAA,CAAC,CAAM,K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AA,IAAA;AAAA,UACN,MAAQ,EAAA,IAAA;AAAA,UACR,OAAS,EAAA,IAAA;AAAA,UACT,QAAU,EAAA,IAAA;AAAA,SACZ;AAAA,OACD,CAAA,CAAA;AAED,MAAA,IAAA,CAAK,KAAQ,GAAA;AAAA,QACX;AAAA,UACE,IAAM,EAAA,OAAA;AAAA,UACN,MAAQ,EAAA,IAAA;AAAA,UACR,KAAO,EAAA,aAAA;AAAA,UACP,KAAO,EAAA;AAAA,YACL,MAAQ,EAAA,GAAA;AAAA,YACR,WAAa,EAAA,GAAA;AAAA,YACb,WAAa,EAAA,GAAA;AAAA,WACf;AAAA,UACA,QAAU,EAAA;AAAA,YACR;AAAA,cACE,IAAM,EAAA,OAAA;AAAA,cACN,MAAQ,EAAA,IAAA;AAAA,cACR,QAAU,EAAA;AAAA,gBACR;AAAA,kBACE,IAAM,EAAA,IAAA;AAAA,kBACN,MAAQ,EAAA,IAAA;AAAA,kBACR,QAAU,EAAA,MAAA;AAAA,iBACZ;AAAA,eACF;AAAA,aACF;AAAA,YACA;AAAA,cACE,IAAM,EAAA,OAAA;AAAA,cACN,MAAQ,EAAA,IAAA;AAAA,cACR,UAAU,GAAI,CAAA,KAAA;AAAA,aAChB;AAAA,WACF;AAAA,SACF;AAAA,OACF,CAAA;AAEA,MAAO,MAAA,EAAA,CAAA;AAAA,KACT,CAAA;AAGA,IAAA,KAAA,CAAM,MAAM,KAAM,CAAA,UAAA,EAAY,aAAa,EAAE,IAAA,EAAM,MAAM,CAAA,CAAA;AAEzD,IAAA,SAAA,CAAU,MAAM;AACd,MAAS,QAAA,EAAA,CAAA;AACT,MAAY,WAAA,EAAA,CAAA;AAAA,KACb,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
@@ -0,0 +1 @@
|
|
1
|
+
.dk-table-form{overflow:auto;color:#666}.dk-table-form .form-create .el-form-item{margin-bottom:1px}.dk-table-form .form-create .el-form-item.is-error{margin-bottom:22px}.dk-table-form .form-create .el-form-item__label{display:none!important}.dk-table-form .form-create .el-form-item__content{display:flex;margin-left:0!important;width:100%!important}.dk-table-form .dk-tf-head-idx,.dk-table-form .dk-tf-idx{width:40px;min-width:40px;font-weight:500;text-align:center}.dk-table-form .dk-tf-btn,.dk-table-form .dk-tf-edit{width:70px;min-width:70px;text-align:center}.dk-table-form .dk-tf-btn .fc-icon,.dk-table-form .dk-tf-edit .fc-icon{cursor:pointer}.dk-table-form.dk-disabled .dk-tf-btn .fc-icon,.dk-table-form.dk-disabled>.el-button{cursor:not-allowed}.dk-table-form .dk-tf-table{width:100%;height:100%;overflow:hidden;table-layout:fixed;border:1px solid #ebeef5;border-bottom:0 none}.dk-table-form .dk-tf-table thead tr th{border:0 none;border-bottom:1px solid #ebeef5;height:40px;font-weight:500}.dk-table-form .dk-tf-table thead tr th:not(:first-child){border-left:1px solid #ebeef5}.dk-table-form .dk-tf-table tr{min-height:50px}.dk-table-form .dk-tf-table .dk-read-view{text-align:center;width:100%}.dk-table-form .dk-tf-table td{padding:5px;min-height:50px;min-width:80px;position:relative;box-sizing:border-box;overflow-wrap:break-word;overflow:hidden;border:0 none;border-bottom:1px solid #ebeef5}.dk-table-form .dk-tf-table td:not(:first-child){border-left:1px solid #ebeef5}.dk-table-form .dk-tf-table td .el-cascader,.dk-table-form .dk-tf-table td .el-date-editor,.dk-table-form .dk-tf-table td .el-input-number,.dk-table-form .dk-tf-table td .el-select,.dk-table-form .dk-tf-table td .el-slider{width:100%}
|
@@ -0,0 +1,110 @@
|
|
1
|
+
/* stylelint-disable */
|
2
|
+
.dk-table-form {
|
3
|
+
overflow: auto;
|
4
|
+
color: #666666;
|
5
|
+
|
6
|
+
.form-create {
|
7
|
+
.el-form-item {
|
8
|
+
margin-bottom: 1px;
|
9
|
+
|
10
|
+
&.is-error {
|
11
|
+
margin-bottom: 22px;
|
12
|
+
}
|
13
|
+
|
14
|
+
&__label {
|
15
|
+
display: none !important;
|
16
|
+
}
|
17
|
+
|
18
|
+
&__content {
|
19
|
+
display: flex;
|
20
|
+
margin-left: 0px !important;
|
21
|
+
width: 100% !important;
|
22
|
+
}
|
23
|
+
}
|
24
|
+
}
|
25
|
+
|
26
|
+
.dk-tf-head-idx,
|
27
|
+
.dk-tf-idx {
|
28
|
+
width: 40px;
|
29
|
+
min-width: 40px;
|
30
|
+
font-weight: 500;
|
31
|
+
text-align: center;
|
32
|
+
}
|
33
|
+
|
34
|
+
.dk-tf-edit,
|
35
|
+
.dk-tf-btn {
|
36
|
+
width: 70px;
|
37
|
+
min-width: 70px;
|
38
|
+
text-align: center;
|
39
|
+
|
40
|
+
.fc-icon {
|
41
|
+
cursor: pointer;
|
42
|
+
}
|
43
|
+
}
|
44
|
+
|
45
|
+
&.dk-disabled {
|
46
|
+
.dk-tf-btn .fc-icon,
|
47
|
+
> .el-button {
|
48
|
+
cursor: not-allowed;
|
49
|
+
}
|
50
|
+
}
|
51
|
+
|
52
|
+
.dk-tf-table {
|
53
|
+
width: 100%;
|
54
|
+
height: 100%;
|
55
|
+
overflow: hidden;
|
56
|
+
table-layout: fixed;
|
57
|
+
border: 1px solid #EBEEF5;
|
58
|
+
border-bottom: 0 none;
|
59
|
+
|
60
|
+
thead {
|
61
|
+
tr {
|
62
|
+
th {
|
63
|
+
border: 0 none;
|
64
|
+
border-bottom: 1px solid #EBEEF5;
|
65
|
+
height: 40px;
|
66
|
+
font-weight: 500;
|
67
|
+
|
68
|
+
&:not(:first-child) {
|
69
|
+
border-left: 1px solid #EBEEF5;
|
70
|
+
}
|
71
|
+
}
|
72
|
+
}
|
73
|
+
}
|
74
|
+
|
75
|
+
tr {
|
76
|
+
min-height: 50px;
|
77
|
+
}
|
78
|
+
|
79
|
+
.dk-read-view {
|
80
|
+
text-align: center;
|
81
|
+
width: 100%;
|
82
|
+
}
|
83
|
+
|
84
|
+
td {
|
85
|
+
padding: 5px;
|
86
|
+
min-height: 50px;
|
87
|
+
min-width: 80px;
|
88
|
+
position: relative;
|
89
|
+
box-sizing: border-box;
|
90
|
+
overflow-wrap: break-word;
|
91
|
+
// white-space: nowrap;
|
92
|
+
overflow: hidden;
|
93
|
+
border: 0 none;
|
94
|
+
border-bottom: 1px solid #EBEEF5;
|
95
|
+
|
96
|
+
&:not(:first-child) {
|
97
|
+
border-left: 1px solid #EBEEF5;
|
98
|
+
}
|
99
|
+
|
100
|
+
.el-input-number,
|
101
|
+
.el-select,
|
102
|
+
.el-slider,
|
103
|
+
.el-cascader,
|
104
|
+
.el-date-editor {
|
105
|
+
width: 100%;
|
106
|
+
}
|
107
|
+
}
|
108
|
+
}
|
109
|
+
}
|
110
|
+
/* stylelint-enable */
|
package/lib/index.d.ts
CHANGED