@blueking/ai-ui-sdk 0.1.0-beta.1 → 0.1.0-beta.10
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/common/util.d.ts +6 -0
- package/dist/common/util.ts.js +16 -0
- package/dist/components/render-aside/index.script.vue.js +4 -4
- package/dist/components/render-aside/index.vue.css +9 -9
- package/dist/components/render-aside/index.vue.js +1 -1
- package/dist/components/render-auto-height-textarea/index.vue.css +11 -11
- package/dist/components/render-auto-height-textarea/index.vue.js +1 -1
- package/dist/components/render-collapse/index.vue.css +2 -2
- package/dist/components/render-collapse/index.vue.js +1 -1
- package/dist/components/render-dataset/components/edit-dataset-data/index.script.vue.js.js +367 -0
- package/dist/components/render-dataset/components/edit-dataset-data/index.vue.css +15 -0
- package/dist/components/{render-dataset-detail-origin-data/components/operation-record → render-dataset/components/edit-dataset-data}/index.vue.d.ts +4 -4
- package/dist/components/render-dataset/components/edit-dataset-data/index.vue.js +5 -0
- package/dist/components/render-dataset/components/operation-record/index.script.vue.js.js +139 -0
- package/dist/components/{render-dataset-detail-origin-data → render-dataset}/components/operation-record/index.vue.css +4 -4
- package/dist/components/{render-dataset-detail-origin-data/components/operation-record/table → render-dataset/components/operation-record}/index.vue.d.ts +2 -2
- package/dist/components/render-dataset/components/operation-record/index.vue.js +5 -0
- package/dist/components/{render-dataset-detail-origin-data → render-dataset}/components/operation-record/table/index.script.vue.js.js +35 -39
- package/dist/components/{render-dataset-detail-origin-data → render-dataset}/components/operation-record/table/index.vue.css +1 -1
- package/dist/components/render-dataset/components/operation-record/table/index.vue.d.ts +7 -0
- package/dist/components/render-dataset/components/operation-record/table/index.vue.js +5 -0
- package/dist/components/{render-dataset-detail-origin-data → render-dataset}/components/operation-record/view-op-result/index.script.vue.js.js +21 -19
- package/dist/components/render-dataset/components/operation-record/view-op-result/index.vue.css +12 -0
- package/dist/components/{render-dataset-detail-origin-data → render-dataset}/components/operation-record/view-op-result/index.vue.d.ts +2 -1
- package/dist/components/render-dataset/components/operation-record/view-op-result/index.vue.js +5 -0
- package/dist/components/render-dataset/components/plus-dataset/dataset-footer.script.vue.js.js +2 -2
- package/dist/components/render-dataset/components/plus-dataset/dataset-footer.vue.d.ts +3 -3
- package/dist/components/render-dataset/components/plus-dataset/{dataset-form.script.vue.js.js → dataset-form.script.vue.js} +95 -128
- package/dist/components/render-dataset/components/plus-dataset/dataset-form.vue.d.ts +1 -0
- package/dist/components/render-dataset/components/plus-dataset/dataset-form.vue.js +1 -3
- package/dist/components/render-dataset/components/plus-dataset/index.script.vue.js.js +13 -7
- package/dist/components/render-dataset/components/plus-dataset/index.vue.css +4 -1
- package/dist/components/render-dataset/components/plus-dataset/index.vue.d.ts +3 -2
- package/dist/components/render-dataset/components/plus-dataset/index.vue.js +1 -1
- package/dist/components/render-dataset/components/plus-dataset-data/form/dataset.script.vue.js.js +15 -6
- package/dist/components/render-dataset/components/plus-dataset-data/form/dataset.vue.d.ts +4 -1
- package/dist/components/render-dataset/components/plus-dataset-data/form/file.script.vue.js.js +68 -15
- package/dist/components/render-dataset/components/plus-dataset-data/form/file.vue.d.ts +3 -1
- package/dist/components/render-dataset/components/plus-dataset-data/form/footer.script.vue.js.js +3 -2
- package/dist/components/render-dataset/components/plus-dataset-data/form/footer.vue.css +1 -1
- package/dist/components/render-dataset/components/plus-dataset-data/form/footer.vue.d.ts +1 -0
- package/dist/components/render-dataset/components/plus-dataset-data/form/footer.vue.js +1 -1
- package/dist/components/render-dataset/components/plus-dataset-data/form/index.script.vue.js.js +97 -33
- package/dist/components/render-dataset/components/plus-dataset-data/form/index.vue.css +7 -0
- package/dist/components/render-dataset/components/plus-dataset-data/form/index.vue.d.ts +4 -0
- package/dist/components/render-dataset/components/plus-dataset-data/form/index.vue.js +2 -0
- package/dist/components/render-dataset/components/plus-dataset-data/form/manual.script.vue.js +202 -0
- package/dist/components/render-dataset/components/plus-dataset-data/form/manual.vue.css +8 -0
- package/dist/components/render-dataset/components/plus-dataset-data/form/manual.vue.d.ts +3 -1
- package/dist/components/render-dataset/components/plus-dataset-data/form/manual.vue.js +2 -1
- package/dist/components/render-dataset/components/plus-dataset-data/index.script.vue.js.js +14 -1
- package/dist/components/render-dataset/components/plus-dataset-data/index.vue.d.ts +9 -3
- package/dist/components/render-dataset/components/search-dataset/index.script.vue.js.js +62 -0
- package/dist/components/render-dataset/components/search-dataset/index.vue.d.ts +10 -1
- package/dist/components/render-dataset/components/search-dataset/index.vue.js +1 -2
- package/dist/components/render-dataset/components/search-dataset-data/index.script.vue.js.js +59 -0
- package/dist/components/render-dataset/components/search-dataset-data/index.vue.d.ts +11 -0
- package/dist/components/render-dataset/components/search-dataset-data/index.vue.js +3 -0
- package/dist/components/render-dataset/components/search-operation-record/index.script.vue.js.js +73 -0
- package/dist/components/{render-dataset-detail-origin-data/components/edit-data → render-dataset/components/search-operation-record}/index.vue.d.ts +5 -6
- package/dist/components/render-dataset/components/search-operation-record/index.vue.js +3 -0
- package/dist/components/render-dataset/components/source-type-icon/index.script.vue.js.js +2 -2
- package/dist/components/render-dataset/components/source-type-icon/index.vue.css +3 -3
- package/dist/components/render-dataset/components/source-type-icon/index.vue.js +1 -1
- package/dist/components/render-dataset/index.script.vue.js.js +18 -4
- package/dist/components/render-dataset/index.vue.css +1 -1
- package/dist/components/render-dataset/index.vue.js +1 -1
- package/dist/components/render-dataset-detail/components/header.script.vue.js.js +41 -12
- package/dist/components/render-dataset-detail/components/header.vue.d.ts +5 -1
- package/dist/components/render-dataset-detail/index.script.vue.js.js +11 -1
- package/dist/components/render-dataset-detail/index.vue.d.ts +5 -1
- package/dist/components/render-dataset-detail-origin-data/components/batch-operation/index.script.vue.js.js +88 -11
- package/dist/components/render-dataset-detail-origin-data/components/batch-operation/index.vue.d.ts +12 -1
- package/dist/components/render-dataset-detail-origin-data/components/table/index.script.vue.js +265 -0
- package/dist/components/render-dataset-detail-origin-data/components/table/index.vue.css +1 -1
- package/dist/components/render-dataset-detail-origin-data/components/table/index.vue.d.ts +12 -1
- package/dist/components/render-dataset-detail-origin-data/components/table/index.vue.js +2 -2
- package/dist/components/render-dataset-detail-origin-data/index.script.vue.js.js +88 -28
- package/dist/components/render-dataset-detail-origin-data/index.vue.css +3 -3
- package/dist/components/render-dataset-detail-origin-data/index.vue.d.ts +1 -0
- package/dist/components/render-dataset-detail-origin-data/index.vue.js +1 -1
- package/dist/components/render-dataset-list/components/main.script.vue.js.js +28 -7
- package/dist/components/render-dataset-list/components/main.vue.css +3 -3
- package/dist/components/render-dataset-list/components/main.vue.d.ts +6 -1
- package/dist/components/render-dataset-list/components/main.vue.js +1 -1
- package/dist/components/render-dataset-list/components/table.script.vue.js.js +123 -53
- package/dist/components/render-dataset-list/components/table.vue.d.ts +2 -0
- package/dist/components/render-dataset-list/index.script.vue.js.js +10 -2
- package/dist/components/render-dataset-list/index.vue.d.ts +6 -1
- package/dist/components/render-expand-collapse/index.vue.css +3 -3
- package/dist/components/render-expand-collapse/index.vue.js +1 -1
- package/dist/components/render-file-card/index.script.vue.js.js +2 -2
- package/dist/components/render-file-card/index.vue.css +11 -11
- package/dist/components/render-file-card/index.vue.js +1 -1
- package/dist/components/render-file-type-icon/index.script.vue.js.js +8 -8
- package/dist/components/render-file-type-icon/index.vue.css +5 -5
- package/dist/components/render-file-type-icon/index.vue.js +1 -1
- package/dist/components/render-header/index.vue.css +5 -5
- package/dist/components/render-header/index.vue.js +1 -1
- package/dist/components/render-router-tab/index.vue.css +3 -3
- package/dist/components/render-router-tab/index.vue.js +1 -1
- package/dist/components/render-search-select/index.script.vue.js.js +137 -0
- package/dist/components/render-search-select/index.vue.d.ts +31 -0
- package/dist/components/render-search-select/index.vue.js +3 -0
- package/dist/css/fonts/iconcool.eot +0 -0
- package/dist/css/fonts/iconcool.svg +36 -0
- package/dist/css/fonts/iconcool.ttf +0 -0
- package/dist/css/fonts/iconcool.woff +0 -0
- package/dist/css/iconcool.js +1 -1
- package/dist/css/style.css +38 -2
- package/dist/event/index.ts.js +1 -2
- package/dist/hooks/use-click-proxy.ts.js +1 -1
- package/dist/hooks/use-dataset-http.d.ts +21 -8
- package/dist/hooks/use-dataset-http.ts.js +57 -34
- package/dist/http/fetch/error-interceptor.d.ts +1 -1
- package/dist/http/fetch/error-interceptor.ts.js +15 -25
- package/dist/http/fetch/index.ts.js +3 -2
- package/dist/http/fetch/success-interceptor.ts.js +7 -4
- package/dist/http/helper/agent.d.ts +1 -1
- package/dist/http/helper/dataset.d.ts +25 -20
- package/dist/http/helper/dataset.ts.js +167 -82
- package/dist/types/common.d.ts +8 -0
- package/dist/types/dataset.d.ts +89 -62
- package/dist/types/enum.d.ts +15 -19
- package/dist/types/enum.ts.js +19 -22
- package/package.json +5 -2
- package/dist/components/render-dataset/components/plus-dataset/dataset-form.vue.css +0 -15
- package/dist/components/render-dataset/components/plus-dataset-data/form/manual.script.vue.js.js +0 -163
- package/dist/components/render-dataset/components/search-dataset/index.script.vue.js +0 -7
- package/dist/components/render-dataset-detail-origin-data/components/edit-data/index.script.vue.js.js +0 -268
- package/dist/components/render-dataset-detail-origin-data/components/edit-data/index.vue.css +0 -38
- package/dist/components/render-dataset-detail-origin-data/components/edit-data/index.vue.js +0 -5
- package/dist/components/render-dataset-detail-origin-data/components/operation-record/index.script.vue.js.js +0 -89
- package/dist/components/render-dataset-detail-origin-data/components/operation-record/index.vue.js +0 -5
- package/dist/components/render-dataset-detail-origin-data/components/operation-record/table/index.vue.js +0 -5
- package/dist/components/render-dataset-detail-origin-data/components/operation-record/view-op-result/index.vue.css +0 -6
- package/dist/components/render-dataset-detail-origin-data/components/operation-record/view-op-result/index.vue.js +0 -5
- package/dist/components/render-dataset-detail-origin-data/components/search/index.script.vue.js +0 -7
- package/dist/components/render-dataset-detail-origin-data/components/search/index.vue.d.ts +0 -2
- package/dist/components/render-dataset-detail-origin-data/components/search/index.vue.js +0 -4
- package/dist/components/render-dataset-detail-origin-data/components/table/index.script.vue.js.js +0 -216
package/dist/common/util.d.ts
CHANGED
@@ -41,6 +41,12 @@ export declare const isJSON: (str: string) => boolean;
|
|
41
41
|
* @returns {boolean}
|
42
42
|
*/
|
43
43
|
export declare function isObject(item: any): boolean;
|
44
|
+
/**
|
45
|
+
* 获取 cookie
|
46
|
+
* @param key cookie key
|
47
|
+
* @returns cookie value
|
48
|
+
*/
|
49
|
+
export declare function getCookies(key: string): string;
|
44
50
|
/**
|
45
51
|
* 深度合并多个对象
|
46
52
|
* @param objectArray 待合并列表
|
package/dist/common/util.ts.js
CHANGED
@@ -103,6 +103,22 @@ import { Message } from 'bkui-vue';
|
|
103
103
|
*/ export function isObject(item) {
|
104
104
|
return Object.prototype.toString.apply(item) === '[object Object]';
|
105
105
|
}
|
106
|
+
/**
|
107
|
+
* 获取 cookie
|
108
|
+
* @param key cookie key
|
109
|
+
* @returns cookie value
|
110
|
+
*/ export function getCookies(key) {
|
111
|
+
const arrCookie = document.cookie.split('; '); // 分割
|
112
|
+
const cookiesObj = {};
|
113
|
+
arrCookie.forEach((cookieStr)=>{
|
114
|
+
const arr = cookieStr.split('=');
|
115
|
+
const [key, value] = arr;
|
116
|
+
if (key) {
|
117
|
+
cookiesObj[key] = value;
|
118
|
+
}
|
119
|
+
});
|
120
|
+
return cookiesObj[key];
|
121
|
+
}
|
106
122
|
/**
|
107
123
|
* 深度合并多个对象
|
108
124
|
* @param objectArray 待合并列表
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { defineComponent as _defineComponent, Fragment as _Fragment2, createVNode as _createVNode
|
1
|
+
import { defineComponent as _defineComponent, Fragment as _Fragment2, createVNode as _createVNode } from 'vue';
|
2
2
|
import { renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, createBlock as _createBlock, createElementVNode as _createElementVNode, renderSlot as _renderSlot } from "vue";
|
3
3
|
const _hoisted_1 = {
|
4
4
|
class: "aside-home g-height-full"
|
@@ -19,7 +19,7 @@ export default /*@__PURE__*/ _defineComponent({
|
|
19
19
|
setup (__props, { emit: __emit }) {
|
20
20
|
const props = __props;
|
21
21
|
const emit = __emit;
|
22
|
-
const
|
22
|
+
const RenderTab = ({ tab })=>{
|
23
23
|
var _a;
|
24
24
|
return _createVNode(_Fragment2, null, [
|
25
25
|
_createVNode("li", {
|
@@ -41,7 +41,7 @@ export default /*@__PURE__*/ _defineComponent({
|
|
41
41
|
tab.number
|
42
42
|
]) : null
|
43
43
|
]),
|
44
|
-
(_a = tab.children) === null || _a === void 0 ? void 0 : _a.map((childTab)=>_createVNode(
|
44
|
+
(_a = tab.children) === null || _a === void 0 ? void 0 : _a.map((childTab)=>_createVNode(RenderTab, {
|
45
45
|
"tab": childTab
|
46
46
|
}, null))
|
47
47
|
]);
|
@@ -54,7 +54,7 @@ export default /*@__PURE__*/ _defineComponent({
|
|
54
54
|
return _openBlock(), _createElementBlock("section", _hoisted_1, [
|
55
55
|
_createElementVNode("ul", _hoisted_2, [
|
56
56
|
(_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_ctx.tabs, (tab, index)=>{
|
57
|
-
return _openBlock(), _createBlock(
|
57
|
+
return _openBlock(), _createBlock(RenderTab, {
|
58
58
|
tab: tab,
|
59
59
|
key: index
|
60
60
|
}, null, 8 /* PROPS */ , [
|
@@ -1,12 +1,12 @@
|
|
1
1
|
|
2
|
-
.aside-home[data-v-
|
2
|
+
.aside-home[data-v-4bn8ma4b] {
|
3
3
|
width: 300px;
|
4
4
|
height: 100%;
|
5
5
|
background: #FFFFFF;
|
6
6
|
padding: 16px;
|
7
7
|
border-right: 1px solid #eaebf0;
|
8
8
|
}
|
9
|
-
[data-v-
|
9
|
+
[data-v-4bn8ma4b] .aside-item {
|
10
10
|
width: 268px;
|
11
11
|
line-height: 36px;
|
12
12
|
border-radius: 2px;
|
@@ -16,30 +16,30 @@
|
|
16
16
|
justify-content: space-between;
|
17
17
|
color: #979BA5;
|
18
18
|
}
|
19
|
-
[data-v-
|
19
|
+
[data-v-4bn8ma4b] .aside-item.is-tab {
|
20
20
|
background: #F5F7FA;
|
21
21
|
cursor: pointer;
|
22
22
|
color: #4D4F56;
|
23
23
|
}
|
24
|
-
[data-v-
|
24
|
+
[data-v-4bn8ma4b] .aside-item.is-tab:hover {
|
25
25
|
background: #F0F5FF;
|
26
26
|
}
|
27
|
-
[data-v-
|
27
|
+
[data-v-4bn8ma4b] .aside-item.active {
|
28
28
|
background: #F0F5FF;
|
29
29
|
color: #3A84FF;
|
30
30
|
font-weight: 700;
|
31
31
|
}
|
32
|
-
[data-v-
|
32
|
+
[data-v-4bn8ma4b] .aside-item.active .tab-num {
|
33
33
|
background: #3A84FF;
|
34
34
|
color: #fff;
|
35
35
|
}
|
36
|
-
[data-v-
|
36
|
+
[data-v-4bn8ma4b] .aside-item.active .active-text {
|
37
37
|
color: #3A84FF;
|
38
38
|
}
|
39
|
-
[data-v-
|
39
|
+
[data-v-4bn8ma4b] .aside-item .tab-name {
|
40
40
|
flex: 1;
|
41
41
|
}
|
42
|
-
[data-v-
|
42
|
+
[data-v-4bn8ma4b] .aside-item .tab-num {
|
43
43
|
background: #EAEBF0;
|
44
44
|
border-radius: 2px;
|
45
45
|
margin-left: 5px;
|
@@ -1,40 +1,40 @@
|
|
1
1
|
|
2
|
-
.send-container[data-v-
|
2
|
+
.send-container[data-v-01mw9h41] {
|
3
3
|
position: relative;
|
4
4
|
}
|
5
|
-
.send-container[data-v-
|
5
|
+
.send-container[data-v-01mw9h41]:has(textarea:focus) {
|
6
6
|
z-index: 2;
|
7
7
|
}
|
8
|
-
.send-container:hover .send-clear[data-v-
|
8
|
+
.send-container:hover .send-clear[data-v-01mw9h41] {
|
9
9
|
display: inline-flex !important;
|
10
10
|
}
|
11
|
-
.send-input[data-v-
|
11
|
+
.send-input[data-v-01mw9h41] {
|
12
12
|
width: 100%;
|
13
13
|
flex-direction: row;
|
14
14
|
height: var(--origin-height);
|
15
15
|
}
|
16
|
-
.send-input[data-v-
|
16
|
+
.send-input[data-v-01mw9h41]:has(textarea:focus) {
|
17
17
|
height: var(--text-height);
|
18
18
|
}
|
19
|
-
.send-input[data-v-
|
19
|
+
.send-input[data-v-01mw9h41] textarea {
|
20
20
|
font-size: 12px;
|
21
21
|
line-height: 16px;
|
22
22
|
padding: 7px;
|
23
23
|
resize: none !important;
|
24
24
|
}
|
25
|
-
.send-input[data-v-
|
25
|
+
.send-input[data-v-01mw9h41] textarea::-webkit-scrollbar {
|
26
26
|
width: 4px;
|
27
27
|
height: 4px;
|
28
28
|
}
|
29
|
-
.send-input[data-v-
|
29
|
+
.send-input[data-v-01mw9h41] textarea::-webkit-scrollbar-thumb {
|
30
30
|
height: 5px;
|
31
31
|
border-radius: 3px;
|
32
32
|
background-color: #dcdee5;
|
33
33
|
}
|
34
|
-
.send-input[data-v-
|
34
|
+
.send-input[data-v-01mw9h41] textarea::placeholder {
|
35
35
|
line-height: 16px;
|
36
36
|
}
|
37
|
-
.send-clear[data-v-
|
37
|
+
.send-clear[data-v-01mw9h41] {
|
38
38
|
display: none !important;
|
39
39
|
position: absolute;
|
40
40
|
right: 10px;
|
@@ -43,6 +43,6 @@
|
|
43
43
|
font-size: 14px;
|
44
44
|
cursor: pointer;
|
45
45
|
}
|
46
|
-
.send-clear[data-v-
|
46
|
+
.send-clear[data-v-01mw9h41]:hover {
|
47
47
|
color: #313238;
|
48
48
|
}
|
@@ -1,10 +1,10 @@
|
|
1
1
|
|
2
|
-
.collapse-title[data-v-
|
2
|
+
.collapse-title[data-v-5lepjunl] {
|
3
3
|
height: 28px;
|
4
4
|
background: #F0F1F5;
|
5
5
|
border-radius: 2px;
|
6
6
|
padding: 0 12px;
|
7
7
|
}
|
8
|
-
.collapse-title .is-hidden[data-v-
|
8
|
+
.collapse-title .is-hidden[data-v-5lepjunl] {
|
9
9
|
transform: rotate(-90deg);
|
10
10
|
}
|
@@ -0,0 +1,367 @@
|
|
1
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
2
|
+
try {
|
3
|
+
var info = gen[key](arg);
|
4
|
+
var value = info.value;
|
5
|
+
} catch (error) {
|
6
|
+
reject(error);
|
7
|
+
return;
|
8
|
+
}
|
9
|
+
if (info.done) {
|
10
|
+
resolve(value);
|
11
|
+
} else {
|
12
|
+
Promise.resolve(value).then(_next, _throw);
|
13
|
+
}
|
14
|
+
}
|
15
|
+
function _async_to_generator(fn) {
|
16
|
+
return function() {
|
17
|
+
var self = this, args = arguments;
|
18
|
+
return new Promise(function(resolve, reject) {
|
19
|
+
var gen = fn.apply(self, args);
|
20
|
+
function _next(value) {
|
21
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
22
|
+
}
|
23
|
+
function _throw(err) {
|
24
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
25
|
+
}
|
26
|
+
_next(undefined);
|
27
|
+
});
|
28
|
+
};
|
29
|
+
}
|
30
|
+
function _define_property(obj, key, value) {
|
31
|
+
if (key in obj) {
|
32
|
+
Object.defineProperty(obj, key, {
|
33
|
+
value: value,
|
34
|
+
enumerable: true,
|
35
|
+
configurable: true,
|
36
|
+
writable: true
|
37
|
+
});
|
38
|
+
} else {
|
39
|
+
obj[key] = value;
|
40
|
+
}
|
41
|
+
return obj;
|
42
|
+
}
|
43
|
+
function _object_spread(target) {
|
44
|
+
for(var i = 1; i < arguments.length; i++){
|
45
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
46
|
+
var ownKeys = Object.keys(source);
|
47
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
48
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
49
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
50
|
+
}));
|
51
|
+
}
|
52
|
+
ownKeys.forEach(function(key) {
|
53
|
+
_define_property(target, key, source[key]);
|
54
|
+
});
|
55
|
+
}
|
56
|
+
return target;
|
57
|
+
}
|
58
|
+
function ownKeys(object, enumerableOnly) {
|
59
|
+
var keys = Object.keys(object);
|
60
|
+
if (Object.getOwnPropertySymbols) {
|
61
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
62
|
+
if (enumerableOnly) {
|
63
|
+
symbols = symbols.filter(function(sym) {
|
64
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
65
|
+
});
|
66
|
+
}
|
67
|
+
keys.push.apply(keys, symbols);
|
68
|
+
}
|
69
|
+
return keys;
|
70
|
+
}
|
71
|
+
function _object_spread_props(target, source) {
|
72
|
+
source = source != null ? source : {};
|
73
|
+
if (Object.getOwnPropertyDescriptors) {
|
74
|
+
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
75
|
+
} else {
|
76
|
+
ownKeys(Object(source)).forEach(function(key) {
|
77
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
78
|
+
});
|
79
|
+
}
|
80
|
+
return target;
|
81
|
+
}
|
82
|
+
import { defineComponent as _defineComponent } from 'vue';
|
83
|
+
import { createTextVNode as _createTextVNode, resolveComponent as _resolveComponent, withCtx as _withCtx, createVNode as _createVNode, unref as _unref, createElementVNode as _createElementVNode, toDisplayString as _toDisplayString, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, createBlock as _createBlock, renderList as _renderList, Fragment as _Fragment, resolveDirective as _resolveDirective, withDirectives as _withDirectives, createSlots as _createSlots } from "vue";
|
84
|
+
const _hoisted_1 = {
|
85
|
+
key: 0,
|
86
|
+
class: "g-text-14"
|
87
|
+
};
|
88
|
+
const _hoisted_2 = {
|
89
|
+
key: 1,
|
90
|
+
class: "value-content g-white-space-pre-line g-mb-16"
|
91
|
+
};
|
92
|
+
import { EditLine } from 'bkui-vue/lib/icon';
|
93
|
+
import { ref, watch } from 'vue';
|
94
|
+
import RenderAutoHeightTextarea from '../../../render-auto-height-textarea/index.vue.js';
|
95
|
+
import Collapse from '../../../render-collapse/index.vue.js';
|
96
|
+
import { useDatasetHttp } from '../../../../hooks/use-dataset-http.ts.js';
|
97
|
+
import useTable from '../../../../hooks/use-table.ts.js';
|
98
|
+
export default /*@__PURE__*/ _defineComponent({
|
99
|
+
props: {
|
100
|
+
index: {},
|
101
|
+
datasetId: {},
|
102
|
+
apiPrefix: {}
|
103
|
+
},
|
104
|
+
emits: [
|
105
|
+
"success-edit"
|
106
|
+
],
|
107
|
+
setup (__props, { emit: __emit }) {
|
108
|
+
const props = __props;
|
109
|
+
const emits = __emit;
|
110
|
+
const { updateDatasetData, getDatasetDataList } = useDatasetHttp(props.apiPrefix);
|
111
|
+
const renderFormData = ref();
|
112
|
+
const editFormData = ref();
|
113
|
+
const isShow = ref(false);
|
114
|
+
const loading = ref(false);
|
115
|
+
const showEditKeys = ref([]);
|
116
|
+
const formRef = ref();
|
117
|
+
const handleGetDatasetDataList = (params)=>{
|
118
|
+
return getDatasetDataList(_object_spread({
|
119
|
+
datasetId: props.datasetId
|
120
|
+
}, params));
|
121
|
+
};
|
122
|
+
const { tableData, pagination, isLoading, handlePageChange, triggerApi } = useTable(handleGetDatasetDataList, 'results', {
|
123
|
+
current: 1,
|
124
|
+
limit: 1,
|
125
|
+
count: 0
|
126
|
+
});
|
127
|
+
const handleEdit = (key)=>{
|
128
|
+
showEditKeys.value.push(key);
|
129
|
+
};
|
130
|
+
const handleShow = ()=>{
|
131
|
+
// 设置页码
|
132
|
+
pagination.value.current = props.index + 1;
|
133
|
+
// 获取数据
|
134
|
+
triggerApi();
|
135
|
+
// 展示
|
136
|
+
isShow.value = true;
|
137
|
+
};
|
138
|
+
const handleClose = ()=>{
|
139
|
+
isShow.value = false;
|
140
|
+
return true;
|
141
|
+
};
|
142
|
+
// 确认
|
143
|
+
const handleConfirm = function() {
|
144
|
+
var _ref = _async_to_generator(function*() {
|
145
|
+
try {
|
146
|
+
loading.value = true;
|
147
|
+
// 校验
|
148
|
+
yield formRef.value.validate();
|
149
|
+
// 更新数据
|
150
|
+
const datasetData = _object_spread_props(_object_spread({}, tableData.value[0]), {
|
151
|
+
data: editFormData.value
|
152
|
+
});
|
153
|
+
yield updateDatasetData(datasetData, datasetData.id);
|
154
|
+
// emits
|
155
|
+
emits('success-edit');
|
156
|
+
// 刷新
|
157
|
+
yield triggerApi();
|
158
|
+
} catch (error) {
|
159
|
+
console.error(error);
|
160
|
+
} finally{
|
161
|
+
loading.value = false;
|
162
|
+
}
|
163
|
+
});
|
164
|
+
return function handleConfirm() {
|
165
|
+
return _ref.apply(this, arguments);
|
166
|
+
};
|
167
|
+
}();
|
168
|
+
// 取消
|
169
|
+
const handleCancel = ()=>{
|
170
|
+
showEditKeys.value = [];
|
171
|
+
editFormData.value = _object_spread({}, renderFormData.value);
|
172
|
+
};
|
173
|
+
// 获取数据以后,修改表单数据
|
174
|
+
const handleInitData = ()=>{
|
175
|
+
var _tableData_value_, _tableData_value;
|
176
|
+
showEditKeys.value = [];
|
177
|
+
const formData = tableData === null || tableData === void 0 ? void 0 : (_tableData_value = tableData.value) === null || _tableData_value === void 0 ? void 0 : (_tableData_value_ = _tableData_value[0]) === null || _tableData_value_ === void 0 ? void 0 : _tableData_value_.data;
|
178
|
+
renderFormData.value = _object_spread({}, formData);
|
179
|
+
editFormData.value = _object_spread({}, formData);
|
180
|
+
};
|
181
|
+
watch(()=>tableData.value, handleInitData, {
|
182
|
+
deep: true
|
183
|
+
});
|
184
|
+
return (_ctx, _cache)=>{
|
185
|
+
const _component_bk_button = _resolveComponent("bk-button");
|
186
|
+
const _component_bk_loading = _resolveComponent("bk-loading");
|
187
|
+
const _component_bk_pagination = _resolveComponent("bk-pagination");
|
188
|
+
const _component_bk_form_item = _resolveComponent("bk-form-item");
|
189
|
+
const _component_bk_form = _resolveComponent("bk-form");
|
190
|
+
const _component_bk_sideslider = _resolveComponent("bk-sideslider");
|
191
|
+
const _directive_bk_tooltips = _resolveDirective("bk-tooltips");
|
192
|
+
return _openBlock(), _createElementBlock(_Fragment, null, [
|
193
|
+
_createVNode(_component_bk_button, {
|
194
|
+
text: "",
|
195
|
+
theme: "primary",
|
196
|
+
onClick: handleShow
|
197
|
+
}, {
|
198
|
+
default: _withCtx(()=>_cache[0] || (_cache[0] = [
|
199
|
+
_createTextVNode(" 编辑 ")
|
200
|
+
])),
|
201
|
+
_: 1 /* STABLE */ ,
|
202
|
+
__: [
|
203
|
+
0
|
204
|
+
]
|
205
|
+
}),
|
206
|
+
_createVNode(_component_bk_sideslider, {
|
207
|
+
class: "data-set-edit-slider",
|
208
|
+
width: 960,
|
209
|
+
"is-show": isShow.value,
|
210
|
+
"before-close": handleClose
|
211
|
+
}, _createSlots({
|
212
|
+
header: _withCtx(()=>[
|
213
|
+
_createVNode(_component_bk_loading, {
|
214
|
+
class: "g-flex-row g-justify-between",
|
215
|
+
loading: _unref(isLoading)
|
216
|
+
}, {
|
217
|
+
default: _withCtx(()=>[
|
218
|
+
_cache[1] || (_cache[1] = _createElementVNode("span", null, "编辑数据", -1 /* HOISTED */ )),
|
219
|
+
_cache[2] || (_cache[2] = _createElementVNode("span", {
|
220
|
+
class: "g-gap g-ml-14 g-mr-8"
|
221
|
+
}, null, -1 /* HOISTED */ )),
|
222
|
+
_unref(tableData)[0] ? (_openBlock(), _createElementBlock("span", _hoisted_1, _toDisplayString(`#${_unref(tableData)[0].id}`), 1 /* TEXT */ )) : _createCommentVNode("v-if", true)
|
223
|
+
]),
|
224
|
+
_: 1 /* STABLE */ ,
|
225
|
+
__: [
|
226
|
+
1,
|
227
|
+
2
|
228
|
+
]
|
229
|
+
}, 8 /* PROPS */ , [
|
230
|
+
"loading"
|
231
|
+
]),
|
232
|
+
isShow.value && showEditKeys.value.length <= 0 ? (_openBlock(), _createBlock(_component_bk_pagination, {
|
233
|
+
key: 0,
|
234
|
+
small: "",
|
235
|
+
class: "g-mr-24",
|
236
|
+
"show-limit": false,
|
237
|
+
"model-value": _ctx.index + 1,
|
238
|
+
count: _unref(pagination).count,
|
239
|
+
limit: 1,
|
240
|
+
"limit-list": [
|
241
|
+
1
|
242
|
+
],
|
243
|
+
onChange: _unref(handlePageChange)
|
244
|
+
}, null, 8 /* PROPS */ , [
|
245
|
+
"model-value",
|
246
|
+
"count",
|
247
|
+
"onChange"
|
248
|
+
])) : _createCommentVNode("v-if", true)
|
249
|
+
]),
|
250
|
+
default: _withCtx(()=>[
|
251
|
+
_createVNode(_component_bk_loading, {
|
252
|
+
loading: _unref(isLoading),
|
253
|
+
class: "content"
|
254
|
+
}, {
|
255
|
+
default: _withCtx(()=>[
|
256
|
+
_createVNode(_component_bk_form, {
|
257
|
+
ref_key: "formRef",
|
258
|
+
ref: formRef,
|
259
|
+
"label-width": 0,
|
260
|
+
model: editFormData.value
|
261
|
+
}, {
|
262
|
+
default: _withCtx(()=>[
|
263
|
+
(_openBlock(true), _createElementBlock(_Fragment, null, _renderList(renderFormData.value, (value, key)=>{
|
264
|
+
return _openBlock(), _createBlock(Collapse, {
|
265
|
+
key: key,
|
266
|
+
title: key,
|
267
|
+
class: "g-mb-8"
|
268
|
+
}, {
|
269
|
+
suffix: _withCtx(()=>[
|
270
|
+
_createVNode(_unref(EditLine), {
|
271
|
+
class: "g-ml-10 g-text-blue g-cursor-pointer",
|
272
|
+
onClick: ($event)=>handleEdit(key)
|
273
|
+
}, null, 8 /* PROPS */ , [
|
274
|
+
"onClick"
|
275
|
+
])
|
276
|
+
]),
|
277
|
+
default: _withCtx(()=>[
|
278
|
+
showEditKeys.value.includes(key) ? (_openBlock(), _createBlock(_component_bk_form_item, {
|
279
|
+
key: 0,
|
280
|
+
property: key,
|
281
|
+
required: ""
|
282
|
+
}, {
|
283
|
+
default: _withCtx(()=>[
|
284
|
+
_createVNode(RenderAutoHeightTextarea, {
|
285
|
+
modelValue: editFormData.value[key],
|
286
|
+
"onUpdate:modelValue": ($event)=>editFormData.value[key] = $event,
|
287
|
+
height: 300
|
288
|
+
}, null, 8 /* PROPS */ , [
|
289
|
+
"modelValue",
|
290
|
+
"onUpdate:modelValue"
|
291
|
+
])
|
292
|
+
]),
|
293
|
+
_: 2 /* DYNAMIC */
|
294
|
+
}, 1032 /* PROPS, DYNAMIC_SLOTS */ , [
|
295
|
+
"property"
|
296
|
+
])) : (_openBlock(), _createElementBlock("h5", _hoisted_2, _toDisplayString(value), 1 /* TEXT */ ))
|
297
|
+
]),
|
298
|
+
_: 2 /* DYNAMIC */
|
299
|
+
}, 1032 /* PROPS, DYNAMIC_SLOTS */ , [
|
300
|
+
"title"
|
301
|
+
]);
|
302
|
+
}), 128 /* KEYED_FRAGMENT */ ))
|
303
|
+
]),
|
304
|
+
_: 1 /* STABLE */
|
305
|
+
}, 8 /* PROPS */ , [
|
306
|
+
"model"
|
307
|
+
])
|
308
|
+
]),
|
309
|
+
_: 1 /* STABLE */
|
310
|
+
}, 8 /* PROPS */ , [
|
311
|
+
"loading"
|
312
|
+
])
|
313
|
+
]),
|
314
|
+
_: 2 /* DYNAMIC */
|
315
|
+
}, [
|
316
|
+
showEditKeys.value.length > 0 ? {
|
317
|
+
name: "footer",
|
318
|
+
fn: _withCtx(()=>[
|
319
|
+
_withDirectives((_openBlock(), _createBlock(_component_bk_button, {
|
320
|
+
class: "g-width-88 g-mr-8",
|
321
|
+
theme: "primary",
|
322
|
+
loading: loading.value,
|
323
|
+
onClick: handleConfirm
|
324
|
+
}, {
|
325
|
+
default: _withCtx(()=>_cache[3] || (_cache[3] = [
|
326
|
+
_createTextVNode(" 保存 ")
|
327
|
+
])),
|
328
|
+
_: 1 /* STABLE */ ,
|
329
|
+
__: [
|
330
|
+
3
|
331
|
+
]
|
332
|
+
}, 8 /* PROPS */ , [
|
333
|
+
"loading"
|
334
|
+
])), [
|
335
|
+
[
|
336
|
+
_directive_bk_tooltips,
|
337
|
+
{
|
338
|
+
content: '如数据已审核通过,重新编辑后,将会重新进入待审核状态',
|
339
|
+
placement: 'top'
|
340
|
+
}
|
341
|
+
]
|
342
|
+
]),
|
343
|
+
_createVNode(_component_bk_button, {
|
344
|
+
class: "g-width-88",
|
345
|
+
disabled: loading.value,
|
346
|
+
onClick: handleCancel
|
347
|
+
}, {
|
348
|
+
default: _withCtx(()=>_cache[4] || (_cache[4] = [
|
349
|
+
_createTextVNode(" 取消 ")
|
350
|
+
])),
|
351
|
+
_: 1 /* STABLE */ ,
|
352
|
+
__: [
|
353
|
+
4
|
354
|
+
]
|
355
|
+
}, 8 /* PROPS */ , [
|
356
|
+
"disabled"
|
357
|
+
])
|
358
|
+
]),
|
359
|
+
key: "0"
|
360
|
+
} : undefined
|
361
|
+
]), 1032 /* PROPS, DYNAMIC_SLOTS */ , [
|
362
|
+
"is-show"
|
363
|
+
])
|
364
|
+
], 64 /* STABLE_FRAGMENT */ );
|
365
|
+
};
|
366
|
+
}
|
367
|
+
});
|
@@ -0,0 +1,15 @@
|
|
1
|
+
|
2
|
+
.content[data-v-87a6gpz7] {
|
3
|
+
padding: 18px 24px 0;
|
4
|
+
height: 100%;
|
5
|
+
overflow: auto;
|
6
|
+
}
|
7
|
+
.data-set-edit-slider .value-content[data-v-87a6gpz7] {
|
8
|
+
padding: 16px;
|
9
|
+
border: 1px solid #DCDEE5;
|
10
|
+
line-height: 22px;
|
11
|
+
}
|
12
|
+
.data-set-edit-slider[data-v-87a6gpz7] .bk-sideslider-title {
|
13
|
+
justify-content: space-between;
|
14
|
+
width: 100%;
|
15
|
+
}
|
@@ -1,11 +1,11 @@
|
|
1
1
|
interface IProps {
|
2
|
-
|
3
|
-
|
2
|
+
index: number;
|
3
|
+
datasetId: number;
|
4
4
|
apiPrefix: string;
|
5
5
|
}
|
6
6
|
declare const _default: import("vue").DefineComponent<IProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
7
|
-
"
|
7
|
+
"success-edit": () => any;
|
8
8
|
}, string, import("vue").PublicProps, Readonly<IProps> & Readonly<{
|
9
|
-
"
|
9
|
+
"onSuccess-edit"?: () => any;
|
10
10
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
11
11
|
export default _default;
|