@vipl520/dk-ui 1.0.55 → 1.0.58
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/index.js +54 -20
- package/dist/index.min.js +4 -4
- package/dist/index.min.js.map +1 -1
- package/dist/index.min.mjs +4 -4
- package/dist/index.min.mjs.map +1 -1
- package/dist/index.mjs +54 -20
- package/dist/web-types.json +1 -1
- package/es/style-box-input/src/style-box-input.vue2.mjs +1 -1
- package/es/style-box-input/src/style-box-input.vue2.mjs.map +1 -1
- package/es/table/index.d.ts +15 -0
- package/es/table/src/props.d.ts +4 -0
- package/es/table/src/props.mjs +6 -0
- package/es/table/src/props.mjs.map +1 -1
- package/es/table/src/table.vue.d.ts +9 -0
- package/es/table/src/table.vue2.mjs +1 -1
- package/es/table/src/table.vue2.mjs.map +1 -1
- package/es/table/utils/dkTable.d.ts +1 -1
- package/es/table/utils/dkTable.mjs +2 -2
- package/es/table/utils/dkTable.mjs.map +1 -1
- package/es/table/utils/dkTableApi.d.ts +3 -1
- package/es/table/utils/dkTableApi.mjs +21 -12
- package/es/table/utils/dkTableApi.mjs.map +1 -1
- package/es/url-input/index.d.ts +3 -1
- package/es/url-input/src/url-input-content.vue2.mjs +11 -3
- package/es/url-input/src/url-input-content.vue2.mjs.map +1 -1
- package/es/url-input/src/url-input-table.vue2.mjs +3 -1
- package/es/url-input/src/url-input-table.vue2.mjs.map +1 -1
- package/es/url-input/src/url-input.vue.d.ts +3 -1
- package/es/url-input/src/url-input.vue2.mjs +11 -2
- package/es/url-input/src/url-input.vue2.mjs.map +1 -1
- package/lib/style-box-input/src/style-box-input.vue2.js +1 -1
- package/lib/style-box-input/src/style-box-input.vue2.js.map +1 -1
- package/lib/table/index.d.ts +15 -0
- package/lib/table/src/props.d.ts +4 -0
- package/lib/table/src/props.js +6 -0
- package/lib/table/src/props.js.map +1 -1
- package/lib/table/src/table.vue.d.ts +9 -0
- package/lib/table/src/table.vue2.js +1 -1
- package/lib/table/src/table.vue2.js.map +1 -1
- package/lib/table/utils/dkTable.d.ts +1 -1
- package/lib/table/utils/dkTable.js +2 -2
- package/lib/table/utils/dkTable.js.map +1 -1
- package/lib/table/utils/dkTableApi.d.ts +3 -1
- package/lib/table/utils/dkTableApi.js +21 -12
- package/lib/table/utils/dkTableApi.js.map +1 -1
- package/lib/url-input/index.d.ts +3 -1
- package/lib/url-input/src/url-input-content.vue2.js +10 -2
- package/lib/url-input/src/url-input-content.vue2.js.map +1 -1
- package/lib/url-input/src/url-input-table.vue2.js +3 -1
- package/lib/url-input/src/url-input-table.vue2.js.map +1 -1
- package/lib/url-input/src/url-input.vue.d.ts +3 -1
- package/lib/url-input/src/url-input.vue2.js +10 -1
- package/lib/url-input/src/url-input.vue2.js.map +1 -1
- package/package.json +1 -1
@@ -7,31 +7,40 @@ class dkTableApi {
|
|
7
7
|
actionUrl;
|
8
8
|
requestConfig = {};
|
9
9
|
// 新增:用于存储配置的request参数
|
10
|
-
constructor(controllerUrl) {
|
10
|
+
constructor(controllerUrl, query) {
|
11
|
+
const qStr = this.objectToQuery(query);
|
12
|
+
console.log("queryStr", qStr);
|
11
13
|
if (!controllerUrl.endsWith("/")) {
|
12
14
|
controllerUrl += "/";
|
13
15
|
}
|
14
16
|
this.controllerUrl = controllerUrl;
|
15
17
|
this.actionUrl = /* @__PURE__ */ new Map([
|
16
|
-
["index", controllerUrl + "index"],
|
17
|
-
["add", controllerUrl + "add"],
|
18
|
-
["edit", controllerUrl + "edit"],
|
19
|
-
["del", controllerUrl + "del"],
|
20
|
-
["sortable", controllerUrl + "sortable"],
|
21
|
-
["table", controllerUrl + "table"],
|
18
|
+
["index", this.buildFullUrl(controllerUrl + "index", qStr)],
|
19
|
+
["add", this.buildFullUrl(controllerUrl + "add", qStr)],
|
20
|
+
["edit", this.buildFullUrl(controllerUrl + "edit", qStr)],
|
21
|
+
["del", this.buildFullUrl(controllerUrl + "del", qStr)],
|
22
|
+
["sortable", this.buildFullUrl(controllerUrl + "sortable", qStr)],
|
23
|
+
["table", this.buildFullUrl(controllerUrl + "table", qStr)],
|
22
24
|
// 获取表格数据
|
23
|
-
["form", controllerUrl + "form"],
|
25
|
+
["form", this.buildFullUrl(controllerUrl + "form", qStr)],
|
24
26
|
// 获取表单
|
25
|
-
["recycle", controllerUrl + "recycle"],
|
27
|
+
["recycle", this.buildFullUrl(controllerUrl + "recycle", qStr)],
|
26
28
|
// 回收站
|
27
|
-
["recycleTable", controllerUrl + "recycleTable"],
|
29
|
+
["recycleTable", this.buildFullUrl(controllerUrl + "recycleTable", qStr)],
|
28
30
|
// 回收站表格
|
29
|
-
["destroy", controllerUrl + "destroy"],
|
31
|
+
["destroy", this.buildFullUrl(controllerUrl + "destroy", qStr)],
|
30
32
|
// 回收站销毁
|
31
|
-
["restore", controllerUrl + "restore"]
|
33
|
+
["restore", this.buildFullUrl(controllerUrl + "restore", qStr)]
|
32
34
|
// 回收站还原
|
33
35
|
]);
|
34
36
|
}
|
37
|
+
// 新增方法用于构建完整的URL
|
38
|
+
buildFullUrl(baseUrl, queryStr) {
|
39
|
+
return queryStr ? `${baseUrl}?${queryStr}` : baseUrl;
|
40
|
+
}
|
41
|
+
objectToQuery(obj) {
|
42
|
+
return Object.keys(obj).map((key) => encodeURIComponent(key) + "=" + encodeURIComponent(obj[key])).join("&");
|
43
|
+
}
|
35
44
|
/**
|
36
45
|
* 配置request参数
|
37
46
|
* @param config 包含HTTP方法、请求头等额外参数的对象
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"dkTableApi.js","sources":["../../../src/table/utils/dkTableApi.ts"],"sourcesContent":["import { request } from '@vipl520/utils'\n\nexport class dkTableApi {\n private controllerUrl: string\n public actionUrl\n private requestConfig: anyObj = {} // 新增:用于存储配置的request参数\n\n constructor(controllerUrl: string) {\n if (!controllerUrl.endsWith('/')) {\n controllerUrl += '/'\n }\n this.controllerUrl = controllerUrl\n this.actionUrl = new Map([\n ['index', controllerUrl + 'index'],\n ['add', controllerUrl + 'add'],\n ['edit', controllerUrl + 'edit'],\n ['del', controllerUrl + 'del'],\n ['sortable', controllerUrl + 'sortable'],\n ['table', controllerUrl + 'table'], // 获取表格数据\n ['form', controllerUrl + 'form'], // 获取表单\n ['recycle', controllerUrl + 'recycle'], // 回收站\n ['recycleTable', controllerUrl + 'recycleTable'], // 回收站表格\n ['destroy', controllerUrl + 'destroy'], // 回收站销毁\n ['restore', controllerUrl + 'restore'], // 回收站还原\n ])\n }\n\n /**\n * 配置request参数\n * @param config 包含HTTP方法、请求头等额外参数的对象\n */\n configureRequest(config: anyObj) {\n this.requestConfig = { ...config } // 将传入的配置对象浅拷贝到requestConfig\n }\n\n /**\n * 获取表格配置\n */\n table() {\n return request(\n {\n url: this.actionUrl.get('table'),\n method: 'post',\n ...this.requestConfig, // 将requestConfig的内容展开到request的参数中\n },\n {\n code_error_show: true,\n }\n )\n }\n\n /**\n * 获取表格配置\n */\n recycleTable() {\n return request(\n {\n url: this.actionUrl.get('recycleTable'),\n method: 'post',\n ...this.requestConfig,\n },\n {\n code_error_show: true,\n }\n )\n }\n\n /**\n * 获取表单\n */\n form(id?: number) {\n return request(\n {\n url: this.actionUrl.get('form'),\n method: 'post',\n data: { id },\n ...this.requestConfig,\n },\n {\n code_error_show: true,\n }\n )\n }\n\n /**\n * 获取表格列表\n * @param filter\n */\n index(filter: anyObj = {}) {\n return request(\n {\n url: this.actionUrl.get('index'),\n method: 'get',\n params: filter,\n ...this.requestConfig,\n },\n {\n code_error_show: true,\n }\n )\n }\n\n /**\n * 回收站列表\n * @param filter\n */\n recycle(filter: anyObj = {}) {\n return request(\n {\n url: this.actionUrl.get('recycle'),\n method: 'get',\n params: filter,\n ...this.requestConfig,\n },\n {\n code_error_show: true,\n }\n )\n }\n\n /**\n * 编辑\n * @param params\n */\n edit(params: anyObj) {\n return request(\n {\n url: this.actionUrl.get('edit'),\n method: 'get',\n params,\n ...this.requestConfig,\n },\n {\n code_error_show: true,\n }\n )\n }\n\n /**\n * 删除\n * @param ids\n */\n del(ids: number[]) {\n return request(\n {\n url: this.actionUrl.get('del'),\n method: 'DELETE',\n params: {\n ids,\n },\n ...this.requestConfig,\n },\n {\n code_success_show: true,\n code_error_show: true,\n }\n )\n }\n\n /**\n * 销毁\n * @param ids\n */\n destroy(ids: string[]) {\n return request(\n {\n url: this.actionUrl.get('destroy'),\n method: 'POST',\n data: {\n ids,\n },\n ...this.requestConfig,\n },\n {\n code_success_show: true,\n code_error_show: true,\n }\n )\n }\n\n /**\n * 还原\n * @param ids\n */\n restore(ids: string[]) {\n return request(\n {\n url: this.actionUrl.get('restore'),\n method: 'POST',\n data: {\n ids,\n },\n ...this.requestConfig,\n },\n {\n code_success_show: true,\n code_error_show: true,\n }\n )\n }\n\n /**\n * 自定义\n * @param action\n * @param data\n */\n postData(action: string, data: anyObj) {\n return request(\n {\n url: this.actionUrl.has(action) ? this.actionUrl.get(action) : this.controllerUrl + action,\n method: 'post',\n data,\n ...this.requestConfig,\n },\n {\n code_success_show: true,\n code_error_show: true,\n }\n )\n }\n\n /**\n * 排序\n * @param id\n * @param targetId\n */\n sortableApi(id: number, targetId: number) {\n return request(\n {\n url: this.actionUrl.get('sortable'),\n method: 'post',\n data: {\n id,\n targetId,\n },\n ...this.requestConfig,\n },\n {\n code_error_show: true,\n }\n )\n }\n}\n"],"names":["request"],"mappings":";;;;AAEO,MAAM,UAAW,CAAA;AAAA,EACd,aAAA,CAAA;AAAA,EACD,SAAA,CAAA;AAAA,EACC,gBAAwB,EAAC,CAAA;AAAA;AAAA,EAEjC,YAAY,aAAuB,EAAA;AACjC,IAAA,IAAI,CAAC,aAAA,CAAc,QAAS,CAAA,GAAG,CAAG,EAAA;AAChC,MAAiB,aAAA,IAAA,GAAA,CAAA;AAAA,KACnB;AACA,IAAA,IAAA,CAAK,aAAgB,GAAA,aAAA,CAAA;AACrB,IAAK,IAAA,CAAA,SAAA,uBAAgB,GAAI,CAAA;AAAA,MACvB,CAAC,OAAS,EAAA,aAAA,GAAgB,OAAO,CAAA;AAAA,MACjC,CAAC,KAAO,EAAA,aAAA,G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js","sources":["../../../src/table/utils/dkTableApi.ts"],"sourcesContent":["import { request } from '@vipl520/utils'\n\nexport class dkTableApi {\n private controllerUrl: string\n public actionUrl\n private requestConfig: anyObj = {} // 新增:用于存储配置的request参数\n\n constructor(controllerUrl: string, query: Object) {\n const qStr = this.objectToQuery(query)\n console.log('queryStr', qStr)\n\n if (!controllerUrl.endsWith('/')) {\n controllerUrl += '/'\n }\n\n this.controllerUrl = controllerUrl\n\n // 构建带有或不带有查询字符串的完整URL\n this.actionUrl = new Map([\n ['index', this.buildFullUrl(controllerUrl + 'index', qStr)],\n ['add', this.buildFullUrl(controllerUrl + 'add', qStr)],\n ['edit', this.buildFullUrl(controllerUrl + 'edit', qStr)],\n ['del', this.buildFullUrl(controllerUrl + 'del', qStr)],\n ['sortable', this.buildFullUrl(controllerUrl + 'sortable', qStr)],\n ['table', this.buildFullUrl(controllerUrl + 'table', qStr)], // 获取表格数据\n ['form', this.buildFullUrl(controllerUrl + 'form', qStr)], // 获取表单\n ['recycle', this.buildFullUrl(controllerUrl + 'recycle', qStr)], // 回收站\n ['recycleTable', this.buildFullUrl(controllerUrl + 'recycleTable', qStr)], // 回收站表格\n ['destroy', this.buildFullUrl(controllerUrl + 'destroy', qStr)], // 回收站销毁\n ['restore', this.buildFullUrl(controllerUrl + 'restore', qStr)], // 回收站还原\n ])\n }\n\n // 新增方法用于构建完整的URL\n private buildFullUrl(baseUrl: string, queryStr: string): string {\n return queryStr ? `${baseUrl}?${queryStr}` : baseUrl\n }\n\n objectToQuery(obj: any) {\n return Object.keys(obj)\n .map((key) => encodeURIComponent(key) + '=' + encodeURIComponent(obj[key]))\n .join('&')\n }\n\n /**\n * 配置request参数\n * @param config 包含HTTP方法、请求头等额外参数的对象\n */\n configureRequest(config: anyObj) {\n this.requestConfig = { ...config } // 将传入的配置对象浅拷贝到requestConfig\n }\n\n /**\n * 获取表格配置\n */\n table() {\n return request(\n {\n url: this.actionUrl.get('table'),\n method: 'post',\n ...this.requestConfig, // 将requestConfig的内容展开到request的参数中\n },\n {\n code_error_show: true,\n }\n )\n }\n\n /**\n * 获取表格配置\n */\n recycleTable() {\n return request(\n {\n url: this.actionUrl.get('recycleTable'),\n method: 'post',\n ...this.requestConfig,\n },\n {\n code_error_show: true,\n }\n )\n }\n\n /**\n * 获取表单\n */\n form(id?: number) {\n return request(\n {\n url: this.actionUrl.get('form'),\n method: 'post',\n data: { id },\n ...this.requestConfig,\n },\n {\n code_error_show: true,\n }\n )\n }\n\n /**\n * 获取表格列表\n * @param filter\n */\n index(filter: anyObj = {}) {\n return request(\n {\n url: this.actionUrl.get('index'),\n method: 'get',\n params: filter,\n ...this.requestConfig,\n },\n {\n code_error_show: true,\n }\n )\n }\n\n /**\n * 回收站列表\n * @param filter\n */\n recycle(filter: anyObj = {}) {\n return request(\n {\n url: this.actionUrl.get('recycle'),\n method: 'get',\n params: filter,\n ...this.requestConfig,\n },\n {\n code_error_show: true,\n }\n )\n }\n\n /**\n * 编辑\n * @param params\n */\n edit(params: anyObj) {\n return request(\n {\n url: this.actionUrl.get('edit'),\n method: 'get',\n params,\n ...this.requestConfig,\n },\n {\n code_error_show: true,\n }\n )\n }\n\n /**\n * 删除\n * @param ids\n */\n del(ids: number[]) {\n return request(\n {\n url: this.actionUrl.get('del'),\n method: 'DELETE',\n params: {\n ids,\n },\n ...this.requestConfig,\n },\n {\n code_success_show: true,\n code_error_show: true,\n }\n )\n }\n\n /**\n * 销毁\n * @param ids\n */\n destroy(ids: string[]) {\n return request(\n {\n url: this.actionUrl.get('destroy'),\n method: 'POST',\n data: {\n ids,\n },\n ...this.requestConfig,\n },\n {\n code_success_show: true,\n code_error_show: true,\n }\n )\n }\n\n /**\n * 还原\n * @param ids\n */\n restore(ids: string[]) {\n return request(\n {\n url: this.actionUrl.get('restore'),\n method: 'POST',\n data: {\n ids,\n },\n ...this.requestConfig,\n },\n {\n code_success_show: true,\n code_error_show: true,\n }\n )\n }\n\n /**\n * 自定义\n * @param action\n * @param data\n */\n postData(action: string, data: anyObj) {\n return request(\n {\n url: this.actionUrl.has(action) ? this.actionUrl.get(action) : this.controllerUrl + action,\n method: 'post',\n data,\n ...this.requestConfig,\n },\n {\n code_success_show: true,\n code_error_show: true,\n }\n )\n }\n\n /**\n * 排序\n * @param id\n * @param targetId\n */\n sortableApi(id: number, targetId: number) {\n return request(\n {\n url: this.actionUrl.get('sortable'),\n method: 'post',\n data: {\n id,\n targetId,\n },\n ...this.requestConfig,\n },\n {\n code_error_show: true,\n }\n )\n }\n}\n"],"names":["request"],"mappings":";;;;AAEO,MAAM,UAAW,CAAA;AAAA,EACd,aAAA,CAAA;AAAA,EACD,SAAA,CAAA;AAAA,EACC,gBAAwB,EAAC,CAAA;AAAA;AAAA,EAEjC,WAAA,CAAY,eAAuB,KAAe,EAAA;AAChD,IAAM,MAAA,IAAA,GAAO,IAAK,CAAA,aAAA,CAAc,KAAK,CAAA,CAAA;AACrC,IAAQ,OAAA,CAAA,GAAA,CAAI,YAAY,IAAI,CAAA,CAAA;AAE5B,IAAA,IAAI,CAAC,aAAA,CAAc,QAAS,CAAA,GAAG,CAAG,EAAA;AAChC,MAAiB,aAAA,IAAA,GAAA,CAAA;AAAA,KACnB;AAEA,IAAA,IAAA,CAAK,aAAgB,GAAA,aAAA,CAAA;AAGrB,IAAK,IAAA,CAAA,SAAA,uBAAgB,GAAI,CAAA;AAAA,MACvB,CAAC,OAAS,EAAA,IAAA,CAAK,aAAa,aAAgB,GAAA,OAAA,EAAS,IAAI,CAAC,CAAA;AAAA,MAC1D,CAAC,KAAO,EAAA,IAAA,CAAK,aAAa,aAAgB,GAAA,KAAA,EAAO,IAAI,CAAC,CAAA;AAAA,MACtD,CAAC,MAAQ,EAAA,IAAA,CAAK,aAAa,aAAgB,GAAA,MAAA,EAAQ,IAAI,CAAC,CAAA;AAAA,MACxD,CAAC,KAAO,EAAA,IAAA,CAAK,aAAa,aAAgB,GAAA,KAAA,EAAO,IAAI,CAAC,CAAA;AAAA,MACtD,CAAC,UAAY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iB,EAAA,IAAA;AAAA,OACnB;AAAA,KACF,CAAA;AAAA,GACF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,WAAA,CAAY,IAAY,QAAkB,EAAA;AACxC,IAAO,OAAAA,aAAA;AAAA,MACL;AAAA,QACE,GAAK,EAAA,IAAA,CAAK,SAAU,CAAA,GAAA,CAAI,UAAU,CAAA;AAAA,QAClC,MAAQ,EAAA,MAAA;AAAA,QACR,IAAM,EAAA;AAAA,UACJ,EAAA;AAAA,UACA,QAAA;AAAA,SACF;AAAA,QACA,GAAG,IAAK,CAAA,aAAA;AAAA,OACV;AAAA,MACA;AAAA,QACE,eAAiB,EAAA,IAAA;AAAA,OACnB;AAAA,KACF,CAAA;AAAA,GACF;AACF;;;;"}
|
package/lib/url-input/index.d.ts
CHANGED
@@ -11,7 +11,7 @@ export declare const UrlInput: import("@vipl520/utils").WithInstall<import("vue"
|
|
11
11
|
default: () => never[];
|
12
12
|
type: ArrayConstructor;
|
13
13
|
};
|
14
|
-
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:modelValue"[], "update:modelValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
14
|
+
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("input" | "update:modelValue" | "change")[], "input" | "update:modelValue" | "change", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
15
15
|
modelValue: {
|
16
16
|
default: string;
|
17
17
|
type: StringConstructor;
|
@@ -25,7 +25,9 @@ export declare const UrlInput: import("@vipl520/utils").WithInstall<import("vue"
|
|
25
25
|
type: ArrayConstructor;
|
26
26
|
};
|
27
27
|
}>> & {
|
28
|
+
onInput?: ((...args: any[]) => any) | undefined;
|
28
29
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
30
|
+
onChange?: ((...args: any[]) => any) | undefined;
|
29
31
|
}, {
|
30
32
|
modelValue: string;
|
31
33
|
urlData: unknown[];
|
@@ -44,12 +44,20 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
44
44
|
emits: ["submit"],
|
45
45
|
setup(__props, { emit }) {
|
46
46
|
const props = __props;
|
47
|
+
const urlInputData = vue.inject("urlInputData", []);
|
47
48
|
const _urlData = vue.computed(() => {
|
48
49
|
console.log("urlData", props.urlData);
|
49
50
|
if (props.urlData?.length > 0) {
|
50
51
|
return props.urlData;
|
51
52
|
} else {
|
52
|
-
return
|
53
|
+
return urlInputData.urlData;
|
54
|
+
}
|
55
|
+
});
|
56
|
+
const _jumpMinApp = vue.computed(() => {
|
57
|
+
if (urlInputData.jumpMinApp !== void 0) {
|
58
|
+
return urlInputData.jumpMinApp;
|
59
|
+
} else {
|
60
|
+
return props.jumpMinApp;
|
53
61
|
}
|
54
62
|
});
|
55
63
|
const minapp = vue.reactive({
|
@@ -185,7 +193,7 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
185
193
|
vue.createVNode(_component_el_tab_pane, { label: "\u81EA\u5B9A\u4E49\u94FE\u63A5" }, {
|
186
194
|
default: vue.withCtx(() => [
|
187
195
|
vue.createElementVNode("div", _hoisted_12, [
|
188
|
-
|
196
|
+
_jumpMinApp.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_13, [
|
189
197
|
vue.createVNode(_component_el_radio_group, {
|
190
198
|
modelValue: urlType.value,
|
191
199
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => urlType.value = $event),
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"url-input-content.vue2.js","sources":["../../../src/url-input/src/url-input-content.vue"],"sourcesContent":["<script lang=\"ts\">\nimport { defineComponent as __MACROS_defineComponent } from \"vue\";\nexport default /*#__PURE__*/ __MACROS_defineComponent({\n name: 'DkUrlInputContent',\n});\n</script>\n<template>\n <el-tabs tab-position=\"left\" style=\"height: 430px\" class=\"dk-url-input-content\" @tab-change=\"onTabChange()\">\n <el-tab-pane v-for=\"(item, key) in _urlData\" :key=\"key\" :label=\"item.title\">\n <div style=\"padding: 10px\">\n <div v-if=\"item.type === 'table'\">\n <dk-url-input-table :item=\"item\" @on-choose-url=\"onChooseUrl\"></dk-url-input-table>\n </div>\n <div v-else-if=\"item.type === 'component'\">\n <component :is=\"item.componentName\" @on-choose-url=\"onChooseUrl\"></component>\n </div>\n <div v-else>\n <div v-if=\"item.lists?.length > 0\">\n <div v-for=\"(val, k) in item.lists\" :key=\"k\">\n <div v-if=\"val.list\">\n <div style=\"padding-bottom: 10px; font-weight: 700; color: #000\">\n {{ val.title }}\n </div>\n <div class=\"url-list\">\n <div\n v-for=\"(v, k) in val.list\"\n :key=\"k\"\n class=\"url-box\"\n :class=\"chooseUrl == v.url ? 'choose' : ''\"\n @click=\"chooseUrl = v.url\"\n >\n {{ v.title }}\n </div>\n </div>\n </div>\n </div>\n </div>\n <div v-else class=\"url-list\">\n <div\n v-for=\"(val, k) in item.list\"\n :key=\"k\"\n class=\"url-box\"\n :class=\"chooseUrl == val.url ? 'choose' : ''\"\n @click=\"chooseUrl = val.url\"\n >\n {{ val.title }}\n </div>\n </div>\n </div>\n </div>\n </el-tab-pane>\n <el-tab-pane label=\"自定义链接\">\n <div style=\"width: 500px; margin: 100px auto\">\n <div v-if=\"
|
1
|
+
{"version":3,"file":"url-input-content.vue2.js","sources":["../../../src/url-input/src/url-input-content.vue"],"sourcesContent":["<script lang=\"ts\">\nimport { defineComponent as __MACROS_defineComponent } from \"vue\";\nexport default /*#__PURE__*/ __MACROS_defineComponent({\n name: 'DkUrlInputContent',\n});\n</script>\n<template>\n <el-tabs tab-position=\"left\" style=\"height: 430px\" class=\"dk-url-input-content\" @tab-change=\"onTabChange()\">\n <el-tab-pane v-for=\"(item, key) in _urlData\" :key=\"key\" :label=\"item.title\">\n <div style=\"padding: 10px\">\n <div v-if=\"item.type === 'table'\">\n <dk-url-input-table :item=\"item\" @on-choose-url=\"onChooseUrl\"></dk-url-input-table>\n </div>\n <div v-else-if=\"item.type === 'component'\">\n <component :is=\"item.componentName\" @on-choose-url=\"onChooseUrl\"></component>\n </div>\n <div v-else>\n <div v-if=\"item.lists?.length > 0\">\n <div v-for=\"(val, k) in item.lists\" :key=\"k\">\n <div v-if=\"val.list\">\n <div style=\"padding-bottom: 10px; font-weight: 700; color: #000\">\n {{ val.title }}\n </div>\n <div class=\"url-list\">\n <div\n v-for=\"(v, k) in val.list\"\n :key=\"k\"\n class=\"url-box\"\n :class=\"chooseUrl == v.url ? 'choose' : ''\"\n @click=\"chooseUrl = v.url\"\n >\n {{ v.title }}\n </div>\n </div>\n </div>\n </div>\n </div>\n <div v-else class=\"url-list\">\n <div\n v-for=\"(val, k) in item.list\"\n :key=\"k\"\n class=\"url-box\"\n :class=\"chooseUrl == val.url ? 'choose' : ''\"\n @click=\"chooseUrl = val.url\"\n >\n {{ val.title }}\n </div>\n </div>\n </div>\n </div>\n </el-tab-pane>\n <el-tab-pane label=\"自定义链接\">\n <div style=\"width: 500px; margin: 100px auto\">\n <div v-if=\"_jumpMinApp\" style=\"padding-bottom: 20px\">\n <el-radio-group v-model=\"urlType\" class=\"ml-4\">\n <el-radio :value=\"1\" size=\"large\">链接或路径</el-radio>\n <el-radio :value=\"2\" size=\"large\">跳转其他小程序</el-radio>\n </el-radio-group>\n </div>\n <el-form label-width=\"100px\" label-position=\"top\" size=\"default\">\n <div v-if=\"urlType === 1\">\n <el-form-item label=\"填写地址或路径\" required>\n <el-input v-model=\"chooseUrl\" size=\"default\" />\n </el-form-item>\n </div>\n <div v-else>\n <el-form-item label=\"填写小程序APPID\" required>\n <el-input v-model=\"minapp.appid\" size=\"default\" />\n </el-form-item>\n <el-form-item label=\"填写小程序路径\">\n <el-input v-model=\"minapp.path\" size=\"default\" />\n </el-form-item>\n </div>\n </el-form>\n </div>\n </el-tab-pane>\n </el-tabs>\n <div style=\"text-align: center\">\n <el-button size=\"default\" style=\"width: 200px\" type=\"primary\" :disabled=\"!chooseUrl\" @click=\"onSubmit()\">\n 确定\n </el-button>\n </div>\n</template>\n<script lang=\"ts\" setup>\nimport { computed, reactive, ref, watch, inject } from 'vue'\nimport DkUrlInputTable from './url-input-table.vue'\n\n\nconst emit = defineEmits(['submit'])\n\nconst props = defineProps({\n urlData: {\n default: () => {\n return []\n },\n type: Array,\n },\n jumpMinApp: { default: false, type: Boolean },\n})\n\nconst urlInputData: any = inject('urlInputData', [])\n\nconst _urlData: any = computed(() => {\n console.log('urlData', props.urlData)\n if (props.urlData?.length > 0) {\n return props.urlData\n } else {\n return urlInputData.urlData\n }\n})\n\nconst _jumpMinApp = computed(() => {\n if (urlInputData.jumpMinApp !== undefined) {\n return urlInputData.jumpMinApp\n } else {\n return props.jumpMinApp\n }\n})\n\nconst minapp = reactive({\n appid: '',\n path: '',\n})\nconst chooseUrl = ref('')\nconst urlType = ref(1)\n\nconst onTabChange = () => {\n chooseUrl.value = ''\n}\n\nconst onChooseUrl = (url: any) => {\n chooseUrl.value = url\n}\n\nwatch(\n () => minapp,\n () => {\n if (minapp.appid) {\n chooseUrl.value = minapp.appid + '@' + minapp.path || '/'\n }\n },\n {\n deep: true,\n }\n)\n\nconst onSubmit = () => {\n emit('submit', chooseUrl.value)\n}\n</script>\n"],"names":["__MACROS_defineComponent","inject","computed","reactive","ref","watch"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,MAA6B,cAAAA,mBAAyB,CAAA;AAAA,EACpD,IAAM,EAAA,mBAAA;AACR,CAAC,CAAA,CAAA;;;;;;;;;;;;;;;AAgGD,IAAA,MAAM,YAAoB,GAAAC,UAAA,CAAO,cAAgB,EAAA,EAAE,CAAA,CAAA;AAEnD,IAAM,MAAA,QAAA,GAAgBC,aAAS,MAAM;AACnC,MAAQ,OAAA,CAAA,GAAA,CAAI,SAAW,EAAA,KAAA,CAAM,OAAO,CAAA,CAAA;AACpC,MAAI,I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,CAAA;AAAA,KAChC,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
@@ -47,7 +47,9 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
47
47
|
ref: DkTableRef,
|
48
48
|
"table-api": __props.item.tableUrl,
|
49
49
|
"cache-table": __props.item.cacheTable,
|
50
|
-
height: "300px"
|
50
|
+
height: "300px",
|
51
|
+
query: { _form: "url_input" },
|
52
|
+
buttons: ["refresh", "add", "export_csv", "edit", "delete", "comSearch", "quickSearch", "columnDisplay"]
|
51
53
|
}, {
|
52
54
|
cate_id_slot: vue.withCtx(({ row }) => [
|
53
55
|
vue.createTextVNode(
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"url-input-table.vue2.js","sources":["../../../src/url-input/src/url-input-table.vue"],"sourcesContent":["<template>\n <dk-table
|
1
|
+
{"version":3,"file":"url-input-table.vue2.js","sources":["../../../src/url-input/src/url-input-table.vue"],"sourcesContent":["<template>\n <dk-table\n ref=\"DkTableRef\"\n :table-api=\"item.tableUrl\"\n :cache-table=\"item.cacheTable\"\n height=\"300px\"\n :query=\"{ _form: 'url_input' }\"\n :buttons=\"['refresh', 'add', 'export_csv', 'edit', 'delete', 'comSearch', 'quickSearch', 'columnDisplay']\"\n >\n <template #cate_id_slot=\"{ row }\">{{ row.category?.name }}</template>\n </dk-table>\n</template>\n<script lang=\"ts\" setup>\nimport { computed, defineComponent, onMounted, ref, watch } from 'vue'\nimport { ElMessage } from 'element-plus'\ndefineComponent({\n name: 'DkUrlInputTable',\n})\nconst props = defineProps({\n item: {\n default: () => {\n return {}\n },\n type: Object,\n },\n})\n\nconst DkTableRef = ref()\nconst selection = computed(() => DkTableRef?.value?.DkTable?.table?.selection || [])\nconst emit = defineEmits(['onChooseUrl'])\n\nwatch(\n () => selection.value.length,\n () => {\n console.log(selection)\n if (selection.value.length > 1) {\n ElMessage({\n message: '选择多个只有最后一个生效',\n type: 'warning',\n })\n }\n const val = selection.value[selection.value.length - 1]\n if (val) {\n const url = val[props.item.urlField] || props.item.urlRule.replace('{pkField}', val[props.item.pkField])\n emit('onChooseUrl', url)\n }\n }\n)\n</script>\n\n<style scoped></style>\n"],"names":["defineComponent","ref","computed","watch","ElMessage"],"mappings":";;;;;;;;;;;;;;;;;;;;AAeA,IAAgBA,mBAAA,CAAA;AAAA,MACd,IAAM,EAAA,iBAAA;AAAA,KACP,CAAA,CAAA;AAUD,IAAA,MAAM,aAAaC,OAAI,EAAA,CAAA;AACvB,IAAM,MAAA,SAAA,GAAYC,aAAS,MAAM,UAAA,EAAY,OAAO,OAAS,EAAA,KAAA,EAAO,SAAa,IAAA,EAAE,CAAA,CAAA;AAGnF,IAAAC,SAAA;AAAA,MACE,MAAM,UAAU,KAAM,CAAA,MAAA;AAAA,MACtB,MAAM;AACJ,QAAA,OAAA,CAAQ,IAAI,SAAS,CAAA,CAAA;AACrB,QAAI,IAAA,SAAA,CAAU,KAAM,CAAA,MAAA,GAAS,CAAG,EAAA;AAC9B,UAAUC,qBAAA,CAAA;AAAA,YACR,OAAS,EAAA,0EAAA;AAAA,YACT,IAAM,EAAA,SAAA;AAAA,WACP,CAAA,CAAA;AAAA,SACH;AACA,QAAA,MAAM,MAAM,SAAU,CAAA,KAAA,CAAM,SAAU,CAAA,KAAA,CAAM,SAAS,CAAC,CAAA,CAAA;AACtD,QAAA,IAAI,GAAK,EAAA;AACP,UAAA,MAAM,GAAM,GAAA,GAAA,CAAI,KAAM,CAAA,IAAA,CAAK,QAAQ,CAAK,IAAA,KAAA,CAAM,IAAK,CAAA,OAAA,CAAQ,QAAQ,WAAa,EAAA,GAAA,CAAI,KAAM,CAAA,IAAA,CAAK,OAAO,CAAC,CAAA,CAAA;AACvG,UAAA,IAAA,CAAK,eAAe,GAAG,CAAA,CAAA;AAAA,SACzB;AAAA,OACF;AAAA,KACF,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
@@ -11,7 +11,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
11
11
|
default: () => never[];
|
12
12
|
type: ArrayConstructor;
|
13
13
|
};
|
14
|
-
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:modelValue"[], "update:modelValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
14
|
+
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("input" | "update:modelValue" | "change")[], "input" | "update:modelValue" | "change", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
15
15
|
modelValue: {
|
16
16
|
default: string;
|
17
17
|
type: StringConstructor;
|
@@ -25,7 +25,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
25
25
|
type: ArrayConstructor;
|
26
26
|
};
|
27
27
|
}>> & {
|
28
|
+
onInput?: ((...args: any[]) => any) | undefined;
|
28
29
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
30
|
+
onChange?: ((...args: any[]) => any) | undefined;
|
29
31
|
}, {
|
30
32
|
modelValue: string;
|
31
33
|
urlData: unknown[];
|
@@ -13,16 +13,25 @@ const __default__ = vue.defineComponent({
|
|
13
13
|
var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
14
14
|
...__default__,
|
15
15
|
props: props.urlInputProps,
|
16
|
-
emits: ["update:modelValue"],
|
16
|
+
emits: ["input", "update:modelValue", "change"],
|
17
17
|
setup(__props, { emit }) {
|
18
18
|
const props = __props;
|
19
19
|
const show = vue.ref(false);
|
20
20
|
const url = vue.ref(props.modelValue);
|
21
21
|
const updateUrl = (value) => {
|
22
|
+
console.log("url", url);
|
22
23
|
url.value = value;
|
23
24
|
emit("update:modelValue", value);
|
24
25
|
show.value = false;
|
25
26
|
};
|
27
|
+
vue.watch(
|
28
|
+
() => url.value,
|
29
|
+
(val) => {
|
30
|
+
emit("update:modelValue", val);
|
31
|
+
emit("input", val);
|
32
|
+
emit("change", val);
|
33
|
+
}
|
34
|
+
);
|
26
35
|
return (_ctx, _cache) => {
|
27
36
|
const _component_el_button = vue.resolveComponent("el-button");
|
28
37
|
const _component_el_input = vue.resolveComponent("el-input");
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"url-input.vue2.js","sources":["../../../src/url-input/src/url-input.vue"],"sourcesContent":["<script lang=\"ts\">\nimport { defineComponent as __MACROS_defineComponent } from \"vue\";\nexport default /*#__PURE__*/ __MACROS_defineComponent({\n name: 'DkUrlInput',\n});\n</script>\n<template>\n <div class=\"dk-url-input\">\n <el-input v-model=\"url\">\n <template #append>\n <el-button @click=\"show = true\">选择</el-button>\n </template>\n </el-input>\n <dk-dialog v-model=\"show\" title=\"选择链接\" width=\"1000px\" append-to-body>\n <DkUrlInputContent\n v-if=\"show\"\n :url-data=\"urlData\"\n :jump-min-app=\"jumpMinApp\"\n @submit=\"updateUrl\"\n ></DkUrlInputContent>\n </dk-dialog>\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport { ref } from 'vue'\nimport DkUrlInputContent from './url-input-content.vue'\nimport { urlInputProps } from './props'\n\n\nconst show = ref(false)\n\nconst props = defineProps(urlInputProps)\n\nconst emit = defineEmits(['update:modelValue'])\nconst url = ref(props.modelValue)\nconst updateUrl = (value: string) => {\n url.value = value\n emit('update:modelValue', value)\n show.value = false\n}\n</script>\n\n<style></style>\n"],"names":["__MACROS_defineComponent","ref"],"mappings":";;;;;;;;;AAEA,MAA6B,cAAAA,mBAAyB,CAAA;AAAA,EACpD,IAAM,EAAA,YAAA;AACR,CAAC,CAAA,CAAA;;;;;;;AA0BD,IAAM,MAAA,IAAA,GAAOC,QAAI,KAAK,CAAA,CAAA;AAKtB,IAAM,MAAA,GAAA,GAAMA,OAAI,CAAA,KAAA,CAAM,UAAU,CAAA,CAAA;AAChC,IAAM,MAAA,SAAA,GAAY,CAAC,KAAkB,KAAA;AACnC,MAAA,GAAA,CAAI,KAAQ,GAAA,KAAA,CAAA;AACZ,MAAA,IAAA,CAAK,qBAAqB,KAAK,CAAA,CAAA;AAC/B,MAAA,IAAA,CAAK,KAAQ,GAAA,KAAA,CAAA;AAAA,KACf,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
1
|
+
{"version":3,"file":"url-input.vue2.js","sources":["../../../src/url-input/src/url-input.vue"],"sourcesContent":["<script lang=\"ts\">\nimport { defineComponent as __MACROS_defineComponent } from \"vue\";\nexport default /*#__PURE__*/ __MACROS_defineComponent({\n name: 'DkUrlInput',\n});\n</script>\n<template>\n <div class=\"dk-url-input\">\n <el-input v-model=\"url\">\n <template #append>\n <el-button @click=\"show = true\">选择</el-button>\n </template>\n </el-input>\n <dk-dialog v-model=\"show\" title=\"选择链接\" width=\"1000px\" append-to-body>\n <DkUrlInputContent\n v-if=\"show\"\n :url-data=\"urlData\"\n :jump-min-app=\"jumpMinApp\"\n @submit=\"updateUrl\"\n ></DkUrlInputContent>\n </dk-dialog>\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport { ref, watch } from 'vue'\nimport DkUrlInputContent from './url-input-content.vue'\nimport { urlInputProps } from './props'\n\n\nconst show = ref(false)\n\nconst props = defineProps(urlInputProps)\n\nconst emit = defineEmits(['input', 'update:modelValue', 'change'])\nconst url = ref(props.modelValue)\nconst updateUrl = (value: string) => {\n console.log('url', url)\n url.value = value\n emit('update:modelValue', value)\n show.value = false\n}\n\nwatch(\n () => url.value,\n (val) => {\n emit('update:modelValue', val)\n emit('input', val)\n emit('change', val)\n }\n)\n</script>\n\n<style></style>\n"],"names":["__MACROS_defineComponent","ref","watch"],"mappings":";;;;;;;;;AAEA,MAA6B,cAAAA,mBAAyB,CAAA;AAAA,EACpD,IAAM,EAAA,YAAA;AACR,CAAC,CAAA,CAAA;;;;;;;AA0BD,IAAM,MAAA,IAAA,GAAOC,QAAI,KAAK,CAAA,CAAA;AAKtB,IAAM,MAAA,GAAA,GAAMA,OAAI,CAAA,KAAA,CAAM,UAAU,CAAA,CAAA;AAChC,IAAM,MAAA,SAAA,GAAY,CAAC,KAAkB,KAAA;AACnC,MAAQ,OAAA,CAAA,GAAA,CAAI,OAAO,GAAG,CAAA,CAAA;AACtB,MAAA,GAAA,CAAI,KAAQ,GAAA,KAAA,CAAA;AACZ,MAAA,IAAA,CAAK,qBAAqB,KAAK,CAAA,CAAA;AAC/B,MAAA,IAAA,CAAK,KAAQ,GAAA,KAAA,CAAA;AAAA,KACf,CAAA;AAEA,IAAAC,SAAA;AAAA,MACE,MAAM,GAAI,CAAA,KAAA;AAAA,MACV,CAAC,GAAQ,KAAA;AACP,QAAA,IAAA,CAAK,qBAAqB,GAAG,CAAA,CAAA;AAC7B,QAAA,IAAA,CAAK,SAAS,GAAG,CAAA,CAAA;AACjB,QAAA,IAAA,CAAK,UAAU,GAAG,CAAA,CAAA;AAAA,OACpB;AAAA,KACF,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|