openyida 2026.11.17 → 2026.11.18-1

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/README.md CHANGED
@@ -554,6 +554,14 @@ When preparing a PR that needs a personal Fork, or when you ask how to support t
554
554
  | `openyida er <appType> [--format mermaid\|json] [--output file] [--include-system] [--include-pages]` | Export app entity relationship diagram |
555
555
  | `openyida create-page <appType> "<name>" [--mode dashboard] [--hide-nav] [--locale zh_CN\|en_US\|ja_JP] [--open\|--no-open]` | Create a custom page |
556
556
  | `openyida create-portal <appType> "<name>" [--locale zh_CN\|en_US\|ja_JP] [--open\|--no-open]` | Create a native YiDA portal |
557
+ | `openyida datav templates <appType> [--page <value>] [--page-size <value>] [--json]` | List native DataV screen templates |
558
+ | `openyida datav create <appType> <name> [--template <value>] [--locale <value>] [--wait-seconds <value>] [--json]` | Create a native YiDA DataV screen |
559
+ | `openyida datav inspect <appType> <formUuid> [--json]` | Inspect native DataV status and URLs |
560
+ | `openyida datav components <appType> <formUuid> [--component <value>] [--category <value>] [--search <value>] [--json]` | List DataV components and parameter definitions |
561
+ | `openyida datav config <appType> <formUuid> [--component <value>] [--json]` | Read DataV canvas and layer configuration |
562
+ | `openyida datav copy <appType> <formUuid> <name> [--locale <value>] [--wait-seconds <value>] [--json]` | Copy a native DataV screen |
563
+ | `openyida datav rename <appType> <formUuid> <name> [--locale <value>] [--json]` | Rename a native DataV screen |
564
+ | `openyida datav publish <appType> <formUuid> --confirm [--json]` | Publish and enable a native DataV screen |
557
565
  | `openyida portal catalog [componentName] [--json]` | List configurable native portal components and theme options |
558
566
  | `openyida portal inspect <appType> <formUuid> [--editable] [--json]` | Inspect native portal tiles and revision |
559
567
  | `openyida portal configure <appType> <formUuid> <file> [--expected-revision <revision>] [--dry-run] [--json]` | Configure native portal tiles and layout |
package/bin/yida.js CHANGED
@@ -860,6 +860,12 @@ async function dispatchCommand() {
860
860
  break;
861
861
  }
862
862
 
863
+ case 'datav': {
864
+ const { run } = require('../lib/app/datav');
865
+ await run(args);
866
+ break;
867
+ }
868
+
863
869
  case 'portal': {
864
870
  const { run } = require('../lib/app/portal');
865
871
  await run(args);
@@ -36,8 +36,9 @@ function fetchAppListPage(auth, pageIndex, pageSize, isAdmin) {
36
36
  _mock: 'false',
37
37
  pageIndex,
38
38
  pageSize,
39
- creator: ref.userId,
40
39
  isAdmin,
40
+ // 管理权限与创建人是独立条件;仅“我创建的”附加创建人筛选。
41
+ ...(isAdmin ? {} : { creator: ref.userId }),
41
42
  _stamp: Date.now(),
42
43
  }));
43
44
  }
@@ -0,0 +1,179 @@
1
+ 'use strict';
2
+
3
+ const https = require('node:https');
4
+ const { CliError } = require('../core/cli-error');
5
+
6
+ const ORIGIN = 'https://datav.aliyun.com';
7
+
8
+ function failure(code = 'DATAV_DESIGNER_UNAVAILABLE') {
9
+ const messages = {
10
+ DATAV_CONFIG_INVALID: 'The saved DataV configuration format is not supported.',
11
+ DATAV_CATALOGUE_INVALID: 'The DataV component catalogue returned an unsupported response.',
12
+ DATAV_COMPONENT_NOT_FOUND: 'No component matches the requested catalogue name or layer ID.',
13
+ };
14
+ return new CliError(messages[code] || 'DataV designer access could not be verified. Open the YiDA designer and check access before retrying.', { code });
15
+ }
16
+
17
+ /** Only the observed YiDA DataV integration origin may receive its temporary ticket. */
18
+ function allowedUrl(value) {
19
+ let url;
20
+ try {url = new URL(value, ORIGIN);} catch {throw failure();}
21
+ if (url.origin !== ORIGIN || url.username || url.password || url.hash) {throw failure();}
22
+ return url;
23
+ }
24
+
25
+ /** A short-lived, memory-only DataV session. YiDA OAuth headers never cross origins. */
26
+ function session(request = https.request) {
27
+ const cookies = new Map();
28
+ async function get(value, redirects = 0) {
29
+ const url = allowedUrl(value);
30
+ return new Promise((resolve, reject) => {
31
+ const req = request(url, { method: 'GET', headers: {
32
+ Accept: '*/*', 'Accept-Encoding': 'identity', 'from-app': 'yida',
33
+ 'X-Requested-With': 'XMLHttpRequest',
34
+ ...(cookies.size ? { Cookie: [...cookies].map(([key, val]) => key + '=' + val).join('; ') } : {}),
35
+ } }, response => {
36
+ for (const entry of response.headers['set-cookie'] || []) {
37
+ const domain = /;\s*domain=([^;]+)/i.exec(entry);
38
+ if (domain && !['datav.aliyun.com', '.datav.aliyun.com'].includes(domain[1].toLowerCase())) {continue;}
39
+ const pair = /^([^=;\s]+)=([^;]*)/.exec(entry);
40
+ if (pair) {cookies.set(pair[1], pair[2]);}
41
+ }
42
+ if ([301, 302, 303, 307, 308].includes(response.statusCode)) {
43
+ response.resume();
44
+ try {
45
+ if (redirects >= 3 || !response.headers.location) {throw failure();}
46
+ resolve(get(allowedUrl(new URL(response.headers.location, url).href).href, redirects + 1));
47
+ } catch {reject(failure());}
48
+ return;
49
+ }
50
+ if (response.statusCode !== 200) {response.resume(); reject(failure()); return;}
51
+ let bytes = 0;
52
+ const chunks = [];
53
+ response.on('data', chunk => {
54
+ bytes += chunk.length;
55
+ if (bytes > 8 * 1024 * 1024) {req.destroy(); reject(failure()); return;}
56
+ chunks.push(chunk);
57
+ });
58
+ response.on('error', () => reject(failure()));
59
+ response.on('end', () => resolve(Buffer.concat(chunks).toString('utf8')));
60
+ });
61
+ req.setTimeout(30000, () => {req.destroy(); reject(failure());});
62
+ req.on('error', () => reject(failure()));
63
+ req.end();
64
+ });
65
+ }
66
+ return { get };
67
+ }
68
+
69
+ /** Parse the JSON payload in Cube's known config envelope without evaluating script. */
70
+ function parseConfig(text, id) {
71
+ const prefix = `Cube("main:/admin/v3/screen/${id}/config.js", [], function (module, exports, require, load, __dirname, __filename) {module.exports = `;
72
+ const suffix = ';\nreturn module.exports;});';
73
+ if (!text.startsWith(prefix) || !text.trimEnd().endsWith(suffix)) {throw failure('DATAV_CONFIG_INVALID');}
74
+ let result;
75
+ try {result = JSON.parse(text.trimEnd().slice(prefix.length, -suffix.length));} catch {throw failure('DATAV_CONFIG_INVALID');}
76
+ if (!result || !Array.isArray(result.scenes) || !result.config || typeof result.config !== 'object') {throw failure('DATAV_CONFIG_INVALID');}
77
+ return result;
78
+ }
79
+
80
+ async function connect(client, metadata) {
81
+ const html = await client.get('/alibaba/web/' + metadata.appType + '/datav/vigoDesigner.html',
82
+ { formUuid: metadata.formUuid }, { responseType: 'text', silentStatus: true });
83
+ const match = typeof html === 'string' && /datavScreenEdit:\s*"([^"\r\n]+)"/.exec(html);
84
+ if (!match) {throw failure();}
85
+ const url = allowedUrl(match[1].replace(/&amp;/g, '&'));
86
+ if (url.pathname !== '/admin/screen/' + metadata.datavId || !url.searchParams.has('x-datav-login-ticket')) {throw failure();}
87
+ const remote = session();
88
+ const editor = await remote.get(url.href);
89
+ if (!editor.includes('configJSPath')) {throw failure();}
90
+ return remote;
91
+ }
92
+
93
+ /** Redact credentials in saved style URLs and bindings; never return share settings. */
94
+ function redact(value) {
95
+ if (Array.isArray(value)) {return value.map(redact);}
96
+ if (value && typeof value === 'object') {
97
+ return Object.fromEntries(Object.entries(value).map(([key, val]) =>
98
+ [key, /token|password|secret|cookie|authorization|credential|ticket|signature|access.?key|api.?key/i.test(key) ? '[redacted]' : redact(val)]));
99
+ }
100
+ if (typeof value === 'string') {
101
+ return value.replace(/([?&](?:[^=&\s]*(?:token|secret|password|ticket|signature|credential|authorization|access.?key|api.?key)[^=&\s]*)=)[^&#\s]*/gi, '$1[redacted]')
102
+ .replace(/(https?:\/\/)[^/\s:@]+:[^/\s@]+@/gi, '$1[redacted]@');
103
+ }
104
+ return value;
105
+ }
106
+
107
+ function screenView(config, component) {
108
+ const scenes = config.scenes.map((scene, index) => ({ index, name: scene.name,
109
+ layers: Object.entries(scene.layers || {}).filter(([id]) => !component || component === id).map(([id, layer]) => ({
110
+ id, comName: layer.comName, version: layer.version, type: layer.type, comType: layer.comType,
111
+ parent: layer.parent, children: layer.children, attr: layer.attr, config: layer.config,
112
+ // Values and remote data-source credentials stay in the native designer.
113
+ dataInterfaces: Object.keys(layer.data || {}),
114
+ })),
115
+ }));
116
+ if (component && !scenes.some(scene => scene.layers.length)) {throw failure('DATAV_COMPONENT_NOT_FOUND');}
117
+ const { width, height, grid, display, backgroundColor, backgroundImage } = config.config;
118
+ return redact({ page: { width, height, grid, display, backgroundColor, backgroundImage }, scenes,
119
+ dataValuesIncluded: false, shareSettingsIncluded: false, writable: false });
120
+ }
121
+
122
+ function categories(entry) {
123
+ const types = [entry.type, entry.config?.type || []].flat().join(',');
124
+ const values = [];
125
+ if (/map|geo|datavgl|guston/.test(types) || /map2d|datavmap|xiongan_blockdata/.test(entry.name || '')) {values.push('map');}
126
+ if (/regular/.test(types)) {values.push('chart');}
127
+ if (/interact|control/.test(types)) {values.push('control');}
128
+ if (/figure|text|:info/.test(types)) {values.push('info');}
129
+ if (/table|list|:table/.test(types)) {values.push('table');}
130
+ if (/media|decorate/.test(types)) {values.push('media');}
131
+ if (/:analysis/.test(types)) {values.push('analysis');}
132
+ return values.length ? values : ['other'];
133
+ }
134
+
135
+ function parameters(fields, prefix = '') {
136
+ return Object.entries(fields || {}).flatMap(([key, field]) => {
137
+ if (!field || typeof field !== 'object') {return [];}
138
+ const path = prefix ? prefix + '.' + key : key;
139
+ const { name, type, description, default: initial, min, max, range, options, show, showInPanel, step, suffix } = field;
140
+ return [{ path, name, type, description, default: initial, min, max, range, options, show, showInPanel, step, suffix },
141
+ ...parameters(field.children, path), ...parameters(field.template?.children, path + '[]')];
142
+ });
143
+ }
144
+
145
+ function catalogueView(entries, args) {
146
+ if (!Array.isArray(entries)) {throw failure('DATAV_CATALOGUE_INVALID');}
147
+ const normalized = entries.map(entry => {
148
+ if (!entry || typeof entry !== 'object') {return {};}
149
+ let config = entry.config;
150
+ if (typeof config === 'string') {
151
+ try {config = JSON.parse(config);} catch {throw failure('DATAV_CATALOGUE_INVALID');}
152
+ }
153
+ return { ...entry, config };
154
+ });
155
+ const selected = normalized.filter(entry => typeof entry.name === 'string' &&
156
+ (!args.category || categories(entry).includes(args.category)) &&
157
+ (!args.component || entry.name === args.component) &&
158
+ (!args.search || (entry.name + ' ' + entry.cn_name).toLowerCase().includes(args.search.toLowerCase())));
159
+ if (args.component && !selected.length) {throw failure('DATAV_COMPONENT_NOT_FOUND');}
160
+ return { source: 'datav_component_catalogue', entitlementVerified: false, installedPackagesIncluded: false,
161
+ total: selected.length, components: selected.map(entry => ({ name: entry.name, title: entry.cn_name || entry.config?.cn_name || entry.name,
162
+ version: entry.version, categories: categories(entry), type: entry.type, level: entry.level,
163
+ dataInterfaces: Object.keys(entry.config?.apis || {}),
164
+ ...(args.component ? { parameterDefinitions: parameters(entry.config?.config), definition: entry.config } : {}),
165
+ })) };
166
+ }
167
+
168
+ async function read(client, metadata, args) {
169
+ const remote = await connect(client, metadata);
170
+ if (args.action === 'config') {
171
+ return screenView(parseConfig(await remote.get('/api/admin/v3/screen/' + metadata.datavId + '/config.js?x-datav-from-app=yida&m=1'), metadata.datavId), args.component);
172
+ }
173
+ let entries;
174
+ const detail = args.component ? '' : '&withoutConfig=true';
175
+ try {entries = JSON.parse(await remote.get('/cube/modules?i18n=zh_CN&x-datav-from-app=yida' + detail));} catch {throw failure('DATAV_CATALOGUE_INVALID');}
176
+ return redact(catalogueView(entries, args));
177
+ }
178
+
179
+ module.exports = { read, allowedUrl, session, parseConfig, screenView, catalogueView };
@@ -0,0 +1,228 @@
1
+ 'use strict';
2
+
3
+ const { parseArgs } = require('node:util');
4
+ const { CliError } = require('../core/cli-error');
5
+ const { createYidaClient, unwrapYidaResponse } = require('../core/yida-client');
6
+ const { buildYidaTitleI18n, normalizeYidaLocale } = require('../core/yida-i18n');
7
+ const { fetchFormSchemaInfo } = require('./get-form-config');
8
+
9
+ const ACTIONS = new Set(['templates', 'create', 'inspect', 'copy', 'rename', 'publish', 'components', 'config']);
10
+ // Native resources use DATAV- IDs; FORM- targets still require a server datav type check.
11
+ const DATAV_RESOURCE_ID = /^(?:DATAV|FORM)-[A-Za-z0-9]+$/;
12
+ const USAGE = 'datav templates <appType> [--page <n>] [--page-size <n>]; datav create <appType> <name> [--template <id>] [--locale <locale>]; datav inspect|publish|config|components <appType> <formUuid>; datav copy|rename <appType> <formUuid> <name>';
13
+
14
+ /** Parse action-specific options before authentication or remote writes. */
15
+ function parse(input) {
16
+ const { positionals, values } = parseArgs({ args: input, allowPositionals: true, options: {
17
+ json: { type: 'boolean' }, confirm: { type: 'boolean' }, template: { type: 'string' }, locale: { type: 'string' },
18
+ page: { type: 'string' }, 'page-size': { type: 'string' }, 'wait-seconds': { type: 'string' },
19
+ component: { type: 'string' }, category: { type: 'string' }, search: { type: 'string' },
20
+ } });
21
+ const [action, appType, formOrName, name] = positionals;
22
+ const length = ['templates'].includes(action) ? 2 : ['copy', 'rename'].includes(action) ? 4 : 3;
23
+ if (!ACTIONS.has(action) || positionals.length !== length || !/^APP_[A-Za-z0-9]+$/.test(appType || '')) {
24
+ throw new CliError(USAGE, { code: 'DATAV_USAGE' });
25
+ }
26
+ const allowed = {
27
+ templates: ['page', 'page-size'], create: ['template', 'locale', 'wait-seconds'],
28
+ copy: ['locale', 'wait-seconds'], rename: ['locale'], inspect: [], publish: ['confirm'],
29
+ components: ['component', 'category', 'search'], config: ['component'],
30
+ }[action];
31
+ if (Object.keys(values).some(key => key !== 'json' && !allowed.includes(key))) {
32
+ throw new CliError(USAGE, { code: 'DATAV_USAGE' });
33
+ }
34
+ const needsForm = !['templates', 'create'].includes(action);
35
+ if (needsForm && !DATAV_RESOURCE_ID.test(formOrName || '')) {
36
+ throw new CliError('A native DataV formUuid is required.', { code: 'DATAV_USAGE' });
37
+ }
38
+ if (action === 'publish' && values.confirm !== true) {
39
+ throw new CliError('Publishing enables the DataV screen. Pass --confirm only when publication is requested.', { code: 'DATAV_PUBLISH_CONFIRM_REQUIRED' });
40
+ }
41
+ const title = action === 'create' ? formOrName : name;
42
+ if (title !== undefined && (!title.trim() || title.length > 150)) {
43
+ throw new CliError('The screen name must contain 1–150 characters.', { code: 'DATAV_USAGE' });
44
+ }
45
+ const locale = values.locale ? normalizeYidaLocale(values.locale) : 'zh_CN';
46
+ if (!locale) {throw new CliError('Unsupported content locale.', { code: 'DATAV_USAGE' });}
47
+ if (values.template !== undefined && !/^\d+$/.test(values.template)) {
48
+ throw new CliError('Use a templateId returned by datav templates.', { code: 'DATAV_USAGE' });
49
+ }
50
+ if (values.category !== undefined && !['chart', 'analysis', 'map', 'info', 'table', 'control', 'media', 'other'].includes(values.category)) {
51
+ throw new CliError('Use category chart|analysis|map|info|table|control|media|other.', { code: 'DATAV_USAGE' });
52
+ }
53
+ if (['component', 'search'].some(key => values[key] !== undefined && (!values[key].trim() || values[key].length > 200))) {
54
+ throw new CliError('Component and search values must contain 1–200 characters.', { code: 'DATAV_USAGE' });
55
+ }
56
+ const integer = (key, fallback, max) => {
57
+ const raw = values[key] === undefined ? String(fallback) : values[key];
58
+ if (!/^\d+$/.test(raw) || Number(raw) > max || (key !== 'wait-seconds' && Number(raw) < 1)) {
59
+ throw new CliError('Invalid --' + key, { code: 'DATAV_USAGE' });
60
+ }
61
+ return Number(raw);
62
+ };
63
+ return { action, appType, formUuid: needsForm ? formOrName : undefined, title, locale,
64
+ template: values.template, page: integer('page', 1, 1000000), pageSize: integer('page-size', 10, 100),
65
+ waitSeconds: integer('wait-seconds', 15, 60), component: values.component, category: values.category, search: values.search };
66
+ }
67
+
68
+ /** Return YiDA-hosted DataV routes; never expose the embedded DataV share token. */
69
+ function urls(client, appType, formUuid) {
70
+ const base = client.getAuthRef().baseUrl.replace(/\/$/, '') + '/alibaba/web/' + appType + '/datav/';
71
+ return { designerUrl: base + 'vigoDesigner.html?formUuid=' + formUuid,
72
+ previewUrl: base + 'preview.html?formUuid=' + formUuid };
73
+ }
74
+
75
+ /** Preserve business error codes, including missing DataV entitlement or quota. */
76
+ function unwrap(response, action) {
77
+ let envelope = response;
78
+ for (let depth = 0; depth < 3; depth++) {
79
+ // DataV's ServiceResult uses result for rename/publish and content for create;
80
+ // MVC may add a second success/content envelope around that ServiceResult.
81
+ const normalized = envelope && (envelope.content === null || envelope.content === undefined) && envelope.result !== undefined
82
+ ? { ...envelope, content: envelope.result } : envelope;
83
+ let value;
84
+ try {value = unwrapYidaResponse(normalized, { action });} catch (error) {
85
+ throw new CliError(error.message, { code: 'DATAV_REQUEST_FAILED',
86
+ details: { platformErrorCode: envelope && envelope.errorCode } });
87
+ }
88
+ if (!value || typeof value !== 'object' || typeof value.success !== 'boolean' || value === envelope) {return value;}
89
+ envelope = value;
90
+ }
91
+ throw new CliError('Unsupported DataV response envelope.', { code: 'DATAV_RESPONSE_INVALID' });
92
+ }
93
+
94
+ /** Read metadata and async readiness for an existing DataV resource only. */
95
+ async function inspect(client, appType, formUuid) {
96
+ const metadata = unwrap(await fetchFormSchemaInfo(client.getAuthRef(), appType, formUuid), 'Read DataV metadata');
97
+ if (metadata.formType !== 'datav' || (metadata.formUuid && metadata.formUuid !== formUuid) ||
98
+ (metadata.appType && metadata.appType !== appType)) {
99
+ throw new CliError('The selected resource must belong to this app and have formType datav.', { code: 'DATAV_TYPE_REQUIRED' });
100
+ }
101
+ const value = unwrap(await client.get('/alibaba/web/' + appType + '/query/datavscreen/getCreateDatavResult.json', { formUuid }), 'Read DataV creation status');
102
+ const ready = /^\d+$/.test(String(value)) && Number.isSafeInteger(Number(value)) && Number(value) > 0;
103
+ return { appType, formUuid, formType: 'datav', title: metadata.title,
104
+ state: ready ? 'ready' : 'pending', datavId: ready ? Number(value) : null, ...urls(client, appType, formUuid) };
105
+ }
106
+
107
+ /** Write once; transport failures carry recovery details instead of replaying a mutation. */
108
+ async function write(client, appType, endpoint, body, target) {
109
+ let response;
110
+ try {
111
+ response = await client.postFormOnce('/alibaba/web/' + appType + '/query/datavscreen/' + endpoint + '.json',
112
+ ref => ({ _csrf_token: ref.csrfToken, ...body }));
113
+ } catch (error) {
114
+ throw new CliError(error.message, { code: 'DATAV_WRITE_UNCERTAIN', details: {
115
+ ...target, sideEffectState: 'unknown', retrySafe: false,
116
+ recovery: target.formUuid ? ['datav', 'inspect', appType, target.formUuid, '--json'] : ['list-forms', appType],
117
+ } });
118
+ }
119
+ return unwrap(response, endpoint);
120
+ }
121
+
122
+ /** Create/copy asynchronously, retaining the resource identity if readiness cannot be verified. */
123
+ async function create(client, args) {
124
+ const { appType, action, title, locale, template, waitSeconds } = args;
125
+ if (action === 'copy') {
126
+ const source = await inspect(client, appType, args.formUuid);
127
+ if (source.state !== 'ready') {throw new CliError('The source DataV screen is not ready.', { code: 'DATAV_NOT_READY' });}
128
+ }
129
+ const titleValue = JSON.stringify(buildYidaTitleI18n(title, { [locale]: title }));
130
+ const body = action === 'copy' ? { formUuid: args.formUuid, appKey: appType, title: titleValue } : {
131
+ formType: 'datav', title: titleValue, parentNavUuid: '', relateFormType: '', relateFormUuid: '',
132
+ ...(template === undefined ? {} : { templateUuid: template }),
133
+ };
134
+ const content = await write(client, appType, action === 'copy' ? 'copyDatavScreen' : 'createDatavScreenInfo', body, { appType });
135
+ const formUuid = typeof content === 'string' ? content : content && (content.formUuid || content.result);
136
+ if (!DATAV_RESOURCE_ID.test(formUuid || '')) {
137
+ throw new CliError('Creation was accepted without a usable formUuid. List existing app pages before retrying.', {
138
+ code: 'DATAV_CREATE_UNVERIFIED', details: { appType, sideEffectState: 'unknown', retrySafe: false, recovery: ['list-forms', appType] },
139
+ });
140
+ }
141
+ const deadline = Date.now() + waitSeconds * 1000;
142
+ try {
143
+ let first = true;
144
+ while (first || Date.now() < deadline) {
145
+ first = false;
146
+ const result = await inspect(client, appType, formUuid);
147
+ if (result.state === 'ready') {return { ...result, created: true, readbackVerified: true };}
148
+ if (Date.now() >= deadline) {break;}
149
+ await new Promise(resolve => setTimeout(resolve, Math.min(1500, deadline - Date.now())));
150
+ }
151
+ } catch (error) {
152
+ throw new CliError(error.message, { code: 'DATAV_CREATE_UNVERIFIED', details: {
153
+ appType, formUuid, created: true, sideEffectState: 'applied', retrySafe: false,
154
+ recovery: ['datav', 'inspect', appType, formUuid, '--json'],
155
+ } });
156
+ }
157
+ throw new CliError('The screen was created but is not ready. Inspect this same formUuid; do not create it again.', {
158
+ code: 'DATAV_CREATE_PENDING', details: { appType, formUuid, created: true, retrySafe: false,
159
+ ...urls(client, appType, formUuid), recovery: ['datav', 'inspect', appType, formUuid, '--json'] },
160
+ });
161
+ }
162
+
163
+ /** Execute source-backed DataV lifecycle operations. Layout editing remains in its native designer. */
164
+ async function run(input) {
165
+ if (input.includes('--help') || input.includes('-h')) {
166
+ const action = input.find(value => !value.startsWith('-'));
167
+ const { COMMAND_GROUPS } = require('../core/command-manifest');
168
+ for (const command of COMMAND_GROUPS.flatMap(group => group.commands)) {
169
+ if (command.path[0] === 'datav' && (!action || action === command.path[1])) {
170
+ process.stdout.write('openyida ' + command.usage + '\n');
171
+ }
172
+ }
173
+ return;
174
+ }
175
+ const args = parse(input);
176
+ const client = createYidaClient();
177
+ const { action, appType, formUuid } = args;
178
+ let result;
179
+ if (action === 'templates') {
180
+ result = { appType, page: args.page, pageSize: args.pageSize,
181
+ templates: unwrap(await client.get('/alibaba/web/' + appType + '/datavtemplate/getTemplateList.json',
182
+ { pageIndex: args.page, pageSize: args.pageSize }), 'List DataV templates') };
183
+ } else if (['create', 'copy'].includes(action)) {
184
+ result = await create(client, args);
185
+ } else {
186
+ result = await inspect(client, appType, formUuid);
187
+ if (['config', 'components'].includes(action)) {
188
+ if (result.state !== 'ready') {throw new CliError('The DataV screen is not ready.', { code: 'DATAV_NOT_READY' });}
189
+ const configuration = await require('./datav-designer').read(client, result, args);
190
+ console.log(JSON.stringify({ success: true, pageType: 'datav', ...result, ...configuration }, null, 2));
191
+ return;
192
+ }
193
+ if (action !== 'inspect') {
194
+ if (result.state !== 'ready') {throw new CliError('The DataV screen is not ready.', { code: 'DATAV_NOT_READY', details: result });}
195
+ let title;
196
+ if (action === 'rename') {
197
+ title = typeof result.title === 'object' && result.title !== null ? { ...result.title } : buildYidaTitleI18n(String(result.title || ''));
198
+ title[args.locale] = args.title;
199
+ // The platform validates zh_CN and uses it to rename the DataV backing screen.
200
+ title.zh_CN = args.title;
201
+ }
202
+ const value = await write(client, appType, action === 'rename' ? 'modifyScreen' : 'saveScreen',
203
+ action === 'rename' ? { formUuid, datavId: result.datavId, screenTitle: JSON.stringify(title) } : { formUuid }, result);
204
+ if (value !== true) {
205
+ throw new CliError('The DataV write result was not confirmed. Inspect before retrying.', {
206
+ code: 'DATAV_WRITE_UNCERTAIN', details: { appType, formUuid, retrySafe: false },
207
+ });
208
+ }
209
+ const before = result;
210
+ try {
211
+ result = await inspect(client, appType, formUuid);
212
+ if (result.state !== 'ready' || before.datavId !== result.datavId ||
213
+ (title && (result.title[args.locale] !== args.title || result.title.zh_CN !== args.title))) {
214
+ throw new Error('DataV readback does not match the requested change.');
215
+ }
216
+ } catch (error) {
217
+ throw new CliError(error.message, { code: 'DATAV_READBACK_UNVERIFIED', details: {
218
+ appType, formUuid, sideEffectState: 'applied', retrySafe: false, recovery: ['datav', 'inspect', appType, formUuid, '--json'],
219
+ } });
220
+ }
221
+ result = { ...result, operation: action, readbackVerified: action === 'rename',
222
+ ...(action === 'publish' ? { publishAccepted: true, enableRequested: true, layoutVerified: false } : {}) };
223
+ }
224
+ }
225
+ console.log(JSON.stringify({ success: true, pageType: 'datav', ...result }, null, 2));
226
+ }
227
+
228
+ module.exports = { run, parse };
@@ -473,6 +473,10 @@ const COMMAND_SIDE_EFFECTS = new Map([
473
473
  'process.fields',
474
474
  'read-dingtalk-tingji',
475
475
  'portal.inspect',
476
+ 'datav.templates',
477
+ 'datav.inspect',
478
+ 'datav.components',
479
+ 'datav.config',
476
480
  'report.inspect',
477
481
  'verify-short-url',
478
482
  ], sideEffect('remote_read')),
@@ -532,6 +536,10 @@ const COMMAND_SIDE_EFFECTS = new Map([
532
536
  'create-form.validation',
533
537
  'create-page',
534
538
  'create-portal',
539
+ 'datav.create',
540
+ 'datav.copy',
541
+ 'datav.rename',
542
+ 'datav.publish',
535
543
  'create-process',
536
544
  'create-report',
537
545
  'externalize-form',
@@ -757,6 +765,10 @@ const COMMAND_PERMISSIONS = new Map([
757
765
  'read-dingtalk-tingji',
758
766
  'portal.catalog',
759
767
  'portal.inspect',
768
+ 'datav.templates',
769
+ 'datav.inspect',
770
+ 'datav.components',
771
+ 'datav.config',
760
772
  'report.inspect',
761
773
  'verify-short-url',
762
774
  ], permission('allow', 'read', {
@@ -805,6 +817,10 @@ const COMMAND_PERMISSIONS = new Map([
805
817
  'create-form.validation',
806
818
  'create-page',
807
819
  'create-portal',
820
+ 'datav.create',
821
+ 'datav.copy',
822
+ 'datav.rename',
823
+ 'datav.publish',
808
824
  'create-process',
809
825
  'create-report',
810
826
  'design-plan.init',
@@ -1783,6 +1799,92 @@ const COMMAND_GROUPS = [
1783
1799
  ],
1784
1800
  notes: ['Use only when users explicitly request a native YiDA portal or explicitly rule out custom pages for that portal. General portal, homepage and workbench requests use create-page and Canvas. On CREATE_PAGE_PORTAL_NOT_VERIFIED, use recovery.command and recovery.args to verify the created page before retrying.'],
1785
1801
  }),
1802
+ command('datav.templates', ['datav', 'templates'], 'datav templates <appType> [--page <value>] [--page-size <value>] [--json]', 'help.cmd_datav_templates', {
1803
+ managedRun: { scope: 'app', appPosition: 1 }, output: 'json',
1804
+ args: [
1805
+ { name: 'appType', type: 'string', source: 'positional', position: 0, required: true },
1806
+ { name: 'page', type: 'string', source: 'option', builder_options: ['--page'] },
1807
+ { name: 'page-size', type: 'string', source: 'option', builder_options: ['--page-size'] },
1808
+ { name: 'json', type: 'boolean', source: 'option', builder_options: ['--json'] },
1809
+ ],
1810
+ notes: ['Returns one page of DataV templates; templateId is passed to create --template. Does not authorize DataV data access.'],
1811
+ }),
1812
+ command('datav.create', ['datav', 'create'], 'datav create <appType> <name> [--template <value>] [--locale <value>] [--wait-seconds <value>] [--json]', 'help.cmd_datav_create', {
1813
+ managedRun: { scope: 'app', appPosition: 1, mutation: { operation: 'create_page' } }, output: 'json',
1814
+ args: [
1815
+ { name: 'appType', type: 'string', source: 'positional', position: 0, required: true },
1816
+ { name: 'name', type: 'string', source: 'positional', position: 1, required: true },
1817
+ { name: 'template', type: 'string', source: 'option', builder_options: ['--template'] },
1818
+ { name: 'locale', type: 'string', source: 'option', builder_options: ['--locale'] },
1819
+ { name: 'wait-seconds', type: 'string', source: 'option', builder_options: ['--wait-seconds'] },
1820
+ { name: 'json', type: 'boolean', source: 'option', builder_options: ['--json'] },
1821
+ ],
1822
+ notes: ['Explicit native DataV requests only. A pending or unverified create returns the existing formUuid and an inspect recovery command. Do not repeat creation. Default wait is 15 seconds, maximum 60. No implicit entitlement changes or authorization.'],
1823
+ }),
1824
+ command('datav.inspect', ['datav', 'inspect'], 'datav inspect <appType> <formUuid> [--json]', 'help.cmd_datav_inspect', {
1825
+ managedRun: { scope: 'app', appPosition: 1 }, output: 'json',
1826
+ args: [
1827
+ { name: 'appType', type: 'string', source: 'positional', position: 0, required: true },
1828
+ { name: 'formUuid', type: 'string', source: 'positional', position: 1, required: true },
1829
+ { name: 'json', type: 'boolean', source: 'option', builder_options: ['--json'] },
1830
+ ],
1831
+ notes: ['Verifies formType datav and reads asynchronous creation readiness; returns YiDA-hosted designer and preview URLs without DataV share tokens.'],
1832
+ }),
1833
+ command('datav.components', ['datav', 'components'], 'datav components <appType> <formUuid> [--component <value>] [--category <value>] [--search <value>] [--json]', 'help.cmd_datav_components', {
1834
+ managedRun: { scope: 'app', appPosition: 1 }, output: 'json',
1835
+ args: [
1836
+ { name: 'appType', type: 'string', source: 'positional', position: 0, required: true },
1837
+ { name: 'formUuid', type: 'string', source: 'positional', position: 1, required: true },
1838
+ { name: 'component', type: 'string', source: 'option', builder_options: ['--component'] },
1839
+ { name: 'category', type: 'string', source: 'option', builder_options: ['--category'] },
1840
+ { name: 'search', type: 'string', source: 'option', builder_options: ['--search'] },
1841
+ { name: 'json', type: 'boolean', source: 'option', builder_options: ['--json'] },
1842
+ ],
1843
+ notes: ['Reads the DataV catalogue through the selected YiDA screen. --component uses a catalogue name and returns its configuration/data/event definitions. Catalogue presence does not verify entitlements or installed commercial packages. Categories: chart, analysis, map, info, table, control, media, other. No mutation or publication.'],
1844
+ }),
1845
+ command('datav.config', ['datav', 'config'], 'datav config <appType> <formUuid> [--component <value>] [--json]', 'help.cmd_datav_config', {
1846
+ managedRun: { scope: 'app', appPosition: 1 }, output: 'json',
1847
+ args: [
1848
+ { name: 'appType', type: 'string', source: 'positional', position: 0, required: true },
1849
+ { name: 'formUuid', type: 'string', source: 'positional', position: 1, required: true },
1850
+ { name: 'component', type: 'string', source: 'option', builder_options: ['--component'] },
1851
+ { name: 'json', type: 'boolean', source: 'option', builder_options: ['--json'] },
1852
+ ],
1853
+ notes: ['Reads saved canvas and layer styles; --component uses a real layer ID. Excludes data values and share settings and redacts credentials. No script evaluation. Read-only: not a complete import/backup format.'],
1854
+ }),
1855
+ command('datav.copy', ['datav', 'copy'], 'datav copy <appType> <formUuid> <name> [--locale <value>] [--wait-seconds <value>] [--json]', 'help.cmd_datav_copy', {
1856
+ managedRun: { scope: 'app', appPosition: 1, mutation: { operation: 'create_page' } }, output: 'json',
1857
+ args: [
1858
+ { name: 'appType', type: 'string', source: 'positional', position: 0, required: true },
1859
+ { name: 'formUuid', type: 'string', source: 'positional', position: 1, required: true },
1860
+ { name: 'name', type: 'string', source: 'positional', position: 2, required: true },
1861
+ { name: 'locale', type: 'string', source: 'option', builder_options: ['--locale'] },
1862
+ { name: 'wait-seconds', type: 'string', source: 'option', builder_options: ['--wait-seconds'] },
1863
+ { name: 'json', type: 'boolean', source: 'option', builder_options: ['--json'] },
1864
+ ],
1865
+ notes: ['Copies a ready native DataV screen within the same app. Pending creation retains the new formUuid for inspect recovery. No automatic replay on uncertain writes.'],
1866
+ }),
1867
+ command('datav.rename', ['datav', 'rename'], 'datav rename <appType> <formUuid> <name> [--locale <value>] [--json]', 'help.cmd_datav_rename', {
1868
+ managedRun: { scope: 'app', appPosition: 1, mutation: { operation: 'update_page', formUuidPosition: 2 } }, output: 'json',
1869
+ args: [
1870
+ { name: 'appType', type: 'string', source: 'positional', position: 0, required: true },
1871
+ { name: 'formUuid', type: 'string', source: 'positional', position: 1, required: true },
1872
+ { name: 'name', type: 'string', source: 'positional', position: 2, required: true },
1873
+ { name: 'locale', type: 'string', source: 'option', builder_options: ['--locale'] },
1874
+ { name: 'json', type: 'boolean', source: 'option', builder_options: ['--json'] },
1875
+ ],
1876
+ notes: ['Renames a ready screen and verifies the title readback; preserves other language titles except zh_CN, which the platform requires for the DataV backing name.'],
1877
+ }),
1878
+ command('datav.publish', ['datav', 'publish'], 'datav publish <appType> <formUuid> --confirm [--json]', 'help.cmd_datav_publish', {
1879
+ managedRun: { scope: 'app', appPosition: 1, mutation: { operation: 'publish_page', formUuidPosition: 2, requiredFlags: ['--confirm'] } }, output: 'json',
1880
+ args: [
1881
+ { name: 'appType', type: 'string', source: 'positional', position: 0, required: true },
1882
+ { name: 'formUuid', type: 'string', source: 'positional', position: 1, required: true },
1883
+ { name: 'confirm', type: 'boolean', source: 'option', required: true, builder_options: ['--confirm'] },
1884
+ { name: 'json', type: 'boolean', source: 'option', builder_options: ['--json'] },
1885
+ ],
1886
+ notes: ['Requires an explicit publication request and --confirm. The platform saveScreen endpoint publishes and enables the DataV screen with token-protected access. Does not accept layout JSON. publishAccepted and enableRequested report the accepted operation; preview verification of layout and data remains required.'],
1887
+ }),
1786
1888
  command('portal.catalog', ['portal', 'catalog'], 'portal catalog [componentName] [--json]', 'help.cmd_portal_catalog', {
1787
1889
  managedRun: { scope: 'local' }, requiresLogin: false, output: 'json',
1788
1890
  args: [{ name: 'componentName', type: 'string', source: 'positional', position: 0 }, { name: 'json', type: 'boolean', source: 'option', builder_options: ['--json'] }],
@@ -295,6 +295,14 @@ module.exports = {
295
295
  cmd_check_prd_completeness: 'Check resources, navigation visibility and application theme',
296
296
  cmd_er: 'Export app entity relationship diagram',
297
297
  cmd_create_page: 'Create a custom page',
298
+ cmd_datav_templates: 'List native DataV screen templates',
299
+ cmd_datav_create: 'Create a native YiDA DataV screen',
300
+ cmd_datav_inspect: 'Inspect native DataV status and URLs',
301
+ cmd_datav_components: 'List DataV components and parameter definitions',
302
+ cmd_datav_config: 'Read DataV canvas and layer configuration',
303
+ cmd_datav_copy: 'Copy a native DataV screen',
304
+ cmd_datav_rename: 'Rename a native DataV screen',
305
+ cmd_datav_publish: 'Publish and enable a native DataV screen',
298
306
  cmd_portal_create: 'Create a native YiDA portal',
299
307
  cmd_portal_catalog: 'List configurable native portal components and theme options',
300
308
  cmd_portal_inspect: 'Inspect native portal tiles and revision',
@@ -295,6 +295,14 @@ module.exports = {
295
295
  cmd_check_prd_completeness: '检查资源、导航显隐及应用主题',
296
296
  cmd_er: '导出应用实体关系图',
297
297
  cmd_create_page: '创建自定义页面',
298
+ cmd_datav_templates: '查询原生大屏模板',
299
+ cmd_datav_create: '创建宜搭原生大屏',
300
+ cmd_datav_inspect: '回读原生大屏状态与入口',
301
+ cmd_datav_components: '查询大屏组件目录与参数定义',
302
+ cmd_datav_config: '读取大屏画布与图层配置',
303
+ cmd_datav_copy: '复制宜搭原生大屏',
304
+ cmd_datav_rename: '修改原生大屏名称',
305
+ cmd_datav_publish: '发布并启用原生 DataV 大屏',
298
306
  cmd_portal_create: '创建宜搭原生门户',
299
307
  cmd_portal_catalog: '查看原生门户可配置的组件和主题',
300
308
  cmd_portal_inspect: '查看原生门户磁贴与版本',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openyida",
3
- "version": "2026.11.17",
3
+ "version": "2026.11.18-1",
4
4
  "description": "OpenYida CLI - AI 宜搭应用开发工具(安装即用,零配置)",
5
5
  "bin": {
6
6
  "openyida": "bin/yida.js",
@@ -174,7 +174,7 @@ Fast / Plan 选定的主题和主色属于整个应用:导航、原生页、
174
174
  | `yida-skills/form` | 表单字段、公式、校验、业务关联规则、原生自定义按钮、消息通知、打印模板、批量录入、数据记录 | `yida-create-form-page`、`yida-custom-button`、`yida-form-message`、`yida-print-template`、`yida-form-view`、`yida-formula`、`yida-formula-evaluate`、`yida-business-rule`、`yida-canvas-table-form`、`yida-table-form`、`yida-data-management` |
175
175
  | `yida-skills/process` | 审批、流程表单、流程规则、节点/分支/字段权限、流程代理 | `yida-create-process`、`yida-process-rule`、`yida-flow-node-config`、`yida-agent-center` |
176
176
  | `yida-skills/page` | 工作台、办事门户、任务看板、自定义展示页、页面源码开发、平台 JSX 组件页面维护、页面发布、页面内导航、PPT 页面 | `yida-create-page`、`yida-create-portal`、`yida-canvas-custom-page`、`yida-custom-page`、`yida-canvas-data-binding`、`yida-task-center`(仅显式选择自定义待办)、`yida-canvas-upgrade`、`yida-publish-page`、`yida-openyida-publish-guard`、`yida-density`、`yida-nav-shell`、`yida-ppt-slider` |
177
- | `yida-skills/analytics` | 用户显式指定宜搭原生数据卡片(含其投放播报);聚合表、虚拟视图、报表、统计、图表、Recharts、ECharts、经营分析看板、驾驶舱、大屏 | `yida-data-card`、`yida-aggregate-table`、`yida-report`、`yida-rechart`、`yida-chart`、`yida-dashboard` |
177
+ | `yida-skills/analytics` | 用户显式指定宜搭原生数据卡片(含其投放播报);聚合表、虚拟视图、报表、统计、图表、Recharts、ECharts、经营分析看板、驾驶舱、大屏 | `yida-data-card`、`yida-aggregate-table`、`yida-report`、`yida-rechart`、`yida-chart`、`yida-dashboard`、`yida-datav`(仅显式原生大屏) |
178
178
  | `yida-skills/integration` | 用户明确指定宜搭平台插件或原生酷卡片;连接器、钉钉开放平台、外部 API、执行动作、设计器数据源、集成自动化、逻辑流 | `yida-plugin-lifecycle`、`yida-plugin-frontend-deploy`、`yida-cool-card`、`yida-integration`、`yida-flow-node-config`、`yida-dingtalk-openapi`、`yida-connector`、`yida-connector-safe-actions`、`yida-data-source-connectors` |
179
179
  | `yida-skills/access` | 平台/应用/表单/页面权限、公开访问、分享 | `yida-corp-manager`、`yida-app-permission`、`yida-form-permission`、`yida-page-config` |
180
180
  | `yida-skills/ops` | Sequence、主键冲突、VOC、OpenYida 本地故障、Issue/Fork PR | `yida-db-seq-fix`、`yida-voc`、`yida-feedback` |
@@ -247,6 +247,8 @@ Fast / Plan 选定的主题和主色属于整个应用:导航、原生页、
247
247
  | 自定义页面中的数据卡片、指标卡、统计卡 | 页面内组件随页面发布:新增/开发走页面技能,接数据走 `yida-canvas-data-binding`,仅外观走 `yida-design`;不自动创建原生 CARD 资源 |
248
248
  | 页面引用了原生 `CARD-xxx` | 按实际修改对象分流:页面外层或引用配置仍归页面;用户明确要求修改源卡片配置才用 `yida-data-card`,不能只凭 CARD/FORM 字样判断 |
249
249
  | 查询主题配置、业务前后台配置或数据卡片管理入口 | 使用 `openyida app-settings <appType> --section theme|basic|data-card|cool-card --json`,直接返回对应 url;只问入口不修改设置 |
250
+ | 明确要求宜搭原生数字大屏、原生数据大屏或 DataV 大屏,或继续已有原生大屏操作 | `yida-datav`,使用 `datav templates/create/inspect/components/config/copy/rename/publish`;CLI 查询组件参数和已保存配置,布局与数据源在原生设计器编辑 |
251
+ | 数字大屏、数据大屏、驾驶舱或投屏监控 | `yida-dashboard` 组织分析内容,默认用 `yida-canvas-custom-page` 承载;仅在用户明确要求宜搭原生大屏时转交 `yida-datav` |
250
252
  | 普通报表/统计、原生报表零值隐藏配置 | `yida-report`;隐藏数值 0 必须由用户明确要求,默认关闭 |
251
253
  | 聚合表 / 虚拟视图的读取、预览、草稿保存或发布 | `yida-aggregate-table`;save 验证 stash revision,publish 验证 live revision |
252
254
  | PPT 页面 | `yida-ppt-slider` |
@@ -14,7 +14,7 @@ description: 创建完整宜搭应用,或补齐已有应用时使用。先确
14
14
  - 功能、角色、流程、视觉选择按 [需求分析](../yida-requirement-analysis/workflow/prepare-brief.md#适用阶段与续做) 核对本次依据,资源按 [上下文识别](workflow/step-1-resource-context.md) 解析。
15
15
  - 范围足以实施后按 [模式路由](../yida-design/references/design-mode.md) 选择 Fast 或 Plan。
16
16
 
17
- **Fast 输入分支**:以 [短执行流程](workflow/fast-build.md) 为唯一 workflow 入口,范围和授权明确即创建/复用应用,按依赖并行;不以 Plan、完整 JSON、build-context、PRD 或设计文档校验作为前置。保留 app_theme.css 和业务校验。按操作加载技能,不逐步读取九阶段或并行长文;旧文档缺项才读 [阶段映射](references/fast-context.md)。Plan 保留原流程。
17
+ **Fast 输入分支**:以 [短执行流程](workflow/fast-build.md) 为唯一 workflow 入口,范围和授权明确即创建/复用应用,按依赖并行;不以 Plan、完整 JSON、build-context、PRD 或设计文档校验作为前置。保留 app_theme.css 和业务校验。主题生成前按[共享主题选择](../yida-design/references/theme-selection.md)确定本轮风格与主色,读取所选模板的真实配色;Fast 没有固定默认主题,不直接沿用命令或样例文件里的主题值。按操作加载技能,不逐步读取九阶段或并行长文;旧文档缺项才读 [阶段映射](references/fast-context.md)。Plan 保留原流程。
18
18
 
19
19
  图片采集不作为创建应用、页面实现或首版预览的前置依赖。布局和交互就绪即按已有发布授权提供可用预览,缺图使用设计允许的明确状态;素材到位仅更新图片绑定。整次采集默认共用60秒截止时间,失败来源立即切换,不 sleep 退避重试;必需图片未齐仍保留最终验收缺口。执行细则见 [素材调度](workflow/parallel-work.md#素材与页面同时推进)。
20
20
 
@@ -135,6 +135,8 @@ Fast 直接按短执行流程内的依赖与调度规则执行;Plan 与其他
135
135
  - 需要收集或存储数据:先创建或复用核心普通表单,再生成页面;纯展示或静态内容可跳过表单创建。
136
136
  - 需要审批、申请、审核、工单流转:先创建或复用流程表单,再生成页面。
137
137
  - 需要标准统计:优先创建原生报表;明确高级图表或大屏时,再选择 `yida-rechart` / `yida-chart`。
138
+ - 数字大屏、数据大屏、驾驶舱和投屏监控默认使用自定义页面承载,由 `yida-dashboard` 组织分析内容、`yida-canvas-custom-page` 实现页面。仅在用户明确要求宜搭原生大屏时加载 `yida-datav`,选择原生承载,并先核实平台能力与操作入口。
139
+ - 创建或编辑大屏前读取本轮应用主题,默认让大屏与应用的品牌色及明暗搭配;浅色应用不直接套用深色模板。原生 DataV 使用 `use_skill("yida-datav", "按当前应用主题创建或编辑原生大屏")` 执行主题前置检查并配置具体样式,自定义页面消费应用主题变量;两种承载均在实际入口连同导航验收,应用主题落地不能代替大屏主题验收。
138
140
  - 用户明确要求宜搭原生门户,或明确排除用自定义页面做门户时,加载 `yida-create-portal`。一般门户、首页和工作台沿用自定义页面流程。
139
141
  - 按页面主任务选技能:经营分析、指标判断或投屏监控页面加载 `yida-dashboard`;综合工作台由 `yida-canvas-custom-page` 实现,按 PRD 组织内容;其中的分析、洞察及快捷操作按实际需要实现,不能仅凭“工作台”或“看板”名称加载经营看板技能。页面读取任何表单业务数据时继续加载 `yida-canvas-data-binding`。
140
142
  - PRD 明确包含报表或集成自动化时,它们属于 Step 4 主流程资源,不得推迟到 final 后置建议;自动化动作必须按通知、数据新增/更新、审批完成、定时或手动触发分别建模,不得统一退化成新增通知。
@@ -22,18 +22,24 @@ openyida create-app --name "应用名称" --desc "本轮业务范围" --json
22
22
 
23
23
  按[入口交接](../../yida-requirement-analysis/references/handoff.md)核对入口场景和默认页;业务工作台列入待建页面,绑定实际业务资源,交付时打开默认入口验收。
24
24
 
25
- **必须生成并应用 `app_theme.css`**,明确禁止 theme-file 的范围除外。使用本轮已选主题和主色;主题未知时一次读取 `design-plan catalog --compact` 作为主题列表,复用已有结果,不运行 init/materialize/preview。目录命令不代表采用 Plan。
25
+ **必须生成并应用 `app_theme.css`**,明确禁止 theme-file 的范围除外。生成前完成本轮选型:
26
+
27
+ 1. 按[共享主题选择](../../yida-design/references/theme-selection.md)复用当前任务的已选风格,或按用户的风格、品牌与参考直接推演;均无时,在内部比较三套方向后选定。Fast 没有固定推荐主题或主色,命令示例和其他应用的选择不作为本轮依据。默认不增加风格问答;用户明确要求预览选型时按其请求执行。
28
+ 2. 需要主题目录时一次读取 `openyida design-plan catalog --json`,按摘要和导航布局兼容性选择,复用已有结果。命名主题选定后读取索引 `templatePath` 的完整主题及 `cssTemplatePath` 的配对 CSS,核对真实表面、文字、强调色和导航明暗,再确定主色;不按主题名称猜测冷暖或材质。目录与模板读取不代表采用 Plan,不运行 init/materialize/preview。
29
+ 3. 在当前任务上下文保留选定主题、主色、选择来源和一句业务理由,沿用共享规则的 `visualDirection.description` 与 `colorStrategy.usage` 说明配色关系。直接用于下面的参数和页面实现,无需新增 JSON、设计文档或确认门槛。
26
30
 
27
31
  ```bash
28
- openyida sample yida-app fast-theme --style-id app-platinum --primary-color '#2E6E8E' --output <绝对路径>/app_theme.css --json
32
+ openyida sample yida-app fast-theme --style-id <本轮选定themeId> --primary-color '<本轮确定的主色>' --output <绝对路径>/app_theme.css --json
29
33
  ```
30
34
 
31
- 示例风格和色值按本轮需求替换。命名主题自动读取配对模板及导航明暗,补齐品牌变量并校验 CSS/文字对比度,不验证业务资源、页面、章节或锚点。返回 `outputs.theme`、`theme.themeColor/navTheme`、`applicationTheme`,不生成任何方案文件。`--check` 只检查本次主题,不写文件;相同产物复用,不同内容保护已有文件,实质改版使用新输出路径。
35
+ 命令中的占位参数须替换为本轮已确定的实际值。命名主题自动读取配对模板及导航明暗,补齐品牌变量并校验 CSS/文字对比度,不验证业务资源、页面、章节或锚点。`--primary-color` 调整品牌色,不会自动把模板中固定的背景、材质和控件颜色整体重配;按[配色协调规则](../../yida-design/references/theme-selection.md#主色与模板表面的协调)判断是否需要 token 覆盖。返回 `outputs.theme`、`theme.themeColor/navTheme`、`applicationTheme`,不生成任何方案文件。`--check` 只检查本次主题,不写文件;相同产物复用,不同内容保护已有文件,实质改版使用新输出路径。
32
36
 
33
37
  命名主题如需覆盖主题变量,可用 `--tokens-file` 传入含 `tokens` 对象的主题 JSON。有明确自由创意需求时使用 `free-creative`,在同一输入中提供 `creativeDirection`,并传 `--nav-theme light|dark`。app-pop 沿用明确风格/展示任务依据,不因 Fast 自动选择。主题 token 与 CSS 消费、旧主题全局作用域确认等规则仍适用。主题失败只暂缓主题应用,主流程继续已授权且独立的资源/页面工作。
34
38
 
35
39
  appType 和 CSS 各自就绪后,按 `yida-create-app` 的 update-app 参数上传主题并设置布局/导航,回读核对。将 applicationTheme 存入逐步积累的 build-manifest。页面直接编写 Canvas 源码并消费共享变量,不补造设计文件或 page-spec。
36
40
 
41
+ 范围内包含数字大屏时,先消费本轮应用实际落地的主题,默认与应用品牌色和明暗搭配。普通大屏用自定义页面消费主题变量;用户明确选择原生 DataV 时加载 `yida-datav`,创建、复制或编辑前读取主题快照,再按组件版本调整画布、图表、地图、控件与浮层。浅色应用不照搬深色模板;保存值回读与应用工作台中的视觉检查分别留证,不以应用主题上传成功代替大屏适配完成。
42
+
37
43
  ## 3. 按操作执行必要业务校验
38
44
 
39
45
  - 只有首页、案例展示/详情和联系我们的展示需求:直接实现页面、导航、联系方式与明确标注的示例内容,默认不创建案例表、留言表、后台或种子数据。用户明确要求提交保存、持续维护、数据库时才创建对应真实数据资源。
@@ -16,6 +16,8 @@ Fast 按 [阶段输入映射](../references/fast-context.md) 直接使用已确
16
16
 
17
17
  主入口叫“门户”“首页”或“工作台”时,默认按自定义页面处理。用户明确要求宜搭原生门户或明确排除用自定义页面做门户时,通过 `use_skill("yida-create-portal", "创建或复用宜搭原生门户")` 处理该页,并交付门户设计器与访问入口。以下自定义页面步骤用于 display 页面。
18
18
 
19
+ 数字大屏、数据大屏、驾驶舱和投屏监控同样默认创建或复用 display 自定义页面,加载 `yida-dashboard` 组织分析内容。仅在用户明确要求宜搭原生大屏时加载 `yida-datav`,选择原生承载,并先核实平台能力与操作入口。
20
+
19
21
  1. 已有页面 URL、`formUuid` 或已绑定 display 页面 → 直接作为主页面,不执行 `use_skill("yida-create-page")`。
20
22
  2. PRD 明确需要自定义业务页面、该页缺失,且 Step 1 允许创建 → 执行 `use_skill("yida-create-page", "创建主入口自定义页面")`。
21
23
  3. 创建页面前核对 PRD/resource context 与 auth snapshot 的 `corpId`。
@@ -45,6 +45,8 @@ Fast 按 [阶段输入映射](../references/fast-context.md) 直接使用已确
45
45
 
46
46
  适用的页面检查按[跨页验收](../../yida-design/references/application-theme-consistency.md#验证主题是否真正一致)核对原生页、自定义页与抽屉;视觉结果单独记录。
47
47
 
48
+ 范围内包含大屏时,核对其品牌色、明暗、画布、图表、地图和控件与当前应用主题搭配,并检查实际入口的导航衔接。原生 DataV 单独按 [主题与应用一致](../../yida-datav/references/components-and-configuration.md#主题与应用一致)回读样式并验收;未检查运行画面时明确保留视觉待验收状态,不能用应用主题完成或大屏创建成功替代。
49
+
48
50
  Fast 将主题命令回执的 `applicationTheme` 写入 `build-manifest.json`。Plan 的 `applicationTheme` 由 CLI 写入 PRD。`check-prd-completeness` 读取当前配置;品牌、CSS 启用或资源不符为 fail,无法读取为 needs_review。局部修改保持原换肤范围。
49
51
 
50
52
  本地验收前后台入口:前台仅页面内导航,后台保留原生导航、管理任务及正确默认页;前台专用页在后台 PC/移动菜单隐藏。`build-manifest` 写入真实资源 ID 后,完整性检查核验 PRD `navigationVisibility`:仍可见为 fail,配置或 ID 未知为 needs_review。历史 PRD 缺字段不算通过,须补清单或回读。
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: yida-dashboard
3
- description: "经营分析看板/驾驶舱/数据大屏产品化交付;用于指标判断、趋势分析或投屏监控,不用于普通待办工作台和办事门户。含真实数据、筛选联动、卡片截图、组织内短链和钉钉待办闭环。常规图表使用 yida-rechart;明确 ECharts、复杂 ECharts option 或维护旧图表时使用 yida-chart。普通统计优先 yida-report。"
3
+ description: "经营分析看板/驾驶舱/数字大屏/数据大屏产品化交付,默认用自定义页面承载;用于指标判断、趋势分析或投屏监控,不用于普通待办工作台和办事门户。含真实数据、筛选联动、卡片截图、组织内短链和钉钉待办闭环。常规图表使用 yida-rechart;明确 ECharts、复杂 ECharts option 或维护旧图表时使用 yida-chart。普通统计优先 yida-report。"
4
4
  license: MIT
5
5
  metadata:
6
6
  audience: developers
@@ -34,11 +34,17 @@ metadata:
34
34
 
35
35
  单个普通统计报表优先 `yida-report`;只解决单张图的实现问题时按“图表路由边界”选择 `yida-rechart` 或 `yida-chart`。
36
36
 
37
+ ## 页面承载
38
+
39
+ - 数字大屏、数据大屏、驾驶舱和投屏监控默认使用自定义页面,由 `yida-canvas-custom-page` 创建页面源码并发布。`screen` 只表示自定义页面的展示场景。
40
+ - 仅在用户明确要求宜搭原生大屏时加载 `yida-datav`,选择原生承载;先核实目标平台的原生大屏能力和操作入口,沿用用户指定的承载方式。
41
+ - 报表或聚合表可以作为自定义大屏的数据来源,数据来源不改变页面承载类型。
42
+
37
43
  ## 默认交付物
38
44
 
39
45
  1. 单屏控制塔结构,见 `references/structure-and-layout.md`。
40
46
  2. 真实数据绑定:聚合指标走报表/聚合结果,明细走分页查询;禁止前端拉全量后聚合。
41
- 3. 视觉主题和信息层级,见 `references/theme-presets.md`。按共享主题选择规则先拒绝第一直觉,再比较新候选;平台预置主题使用应用 `--theme`,自定义色盘使用应用级主题 CSS 文件,页面只消费运行时变量。
47
+ 3. 视觉主题和信息层级,见 `references/theme-presets.md`。先读取应用当前主题与项目设计,已有主题直接沿用;尚无主题时按共享主题选择规则比较候选。平台预置主题使用应用 `--theme`,自定义色盘使用应用级主题 CSS 文件,页面只消费运行时变量。大屏的图表、地图、筛选和浮层一起配套,不因“大屏”自动改为深色科技风。
42
48
  4. 筛选与图表联动;控件必须受控并真实改变下方数据。
43
49
  5. 每元素可派单:`saveFormData → 集成自动化 → 待办2.0 ConnectorCall`。
44
50
  6. 卡片截图分享:真实可点击,截图时排除截图按钮本身。
@@ -182,6 +188,7 @@ use_skill("yida-chart", "实现明确要求的 ECharts 或维护旧 native 图
182
188
  - 发布后回读到 `YidaCodeCanvas` 与非空 `runtimeCode`。
183
189
  - 至少一个 KPI/列表/图表来自真实数据契约;否则标记 draft。
184
190
  - 筛选、刷新、移动端、截图、空/载/错态实际可用。
191
+ - 画布、卡片、图表、地图、控件和浮层符合应用主题;分类色、数值渐变与状态色分别核对,同一业务对象跨图同色。主题切换后重新检查,未实测时保留视觉待验收状态。
185
192
  - 常规图表已使用 `yida-rechart`;使用 `yida-chart` 时交付说明明确命中了哪条 ECharts 例外。
186
193
  - 需要派单时,真实待办 ConnectorCall 和字段映射验证通过。
187
194
  - 隐藏导航时,最终组织内 URL 保留 `isRenderNav=false`。
@@ -2,6 +2,8 @@
2
2
 
3
3
  看板与应用共用 [主题选择规则](../../yida-design/references/theme-selection.md),不另设行业到主题的决策树。先读取当前项目 `design.md`;已有主题直接继承,尚无主题时按共享规则拒绝第一直觉后再比较新候选。
4
4
 
5
+ 搭建前用 `openyida app-settings <appType> --section theme --json` 核对应用主题配置,并读取已有主题 CSS 与当前页面的实际变量;配置回执不能替代运行态检查。Fast 沿用当前主题输入和任务记录,不为此补造 `design.md`。按[共用主题规则](../../yida-design/references/application-theme-consistency.md)保留导航、画布、卡片、文字、字体、圆角和密度的搭配;单页任务不擅自更改应用主题或升级旧主题模式。
6
+
5
7
  ## 根据任务确定视觉方向
6
8
 
7
9
  - “销售经营驾驶数据看板”说明要看业绩、趋势、目标差距或异常,不代表用户指定了蓝色、科技风或深色。先确认主要决策、阅读距离、使用频率与信息密度。
@@ -23,6 +25,12 @@
23
25
 
24
26
  常规图表按 `yida-rechart` 的运行时取色契约;明确 ECharts 或维护旧图表时按 `yida-chart` 解析变量后传入图表。图表库需要具体色值时,读取并解析项目运行时变量,不把 CSS `var(...)` 当作已经解析的 Canvas 颜色。
25
27
 
28
+ 自定义大屏使用 `--pod-page-bg-color`、`--pod-card-bg-color` 等已有角色;antd 控件接入标准 `CanvasThemeProvider`,在其子组件读取 `useCanvasThemeContext()`。图表颜色随主题更新重新生成,ECharts 按依赖变化更新 option。分类色盘缺少共享角色时先补同一份主题输入,再按业务 ID 稳定映射,不因筛选后的数组顺序改变颜色。
29
+
30
+ 地图底图、边界和标注与画布明暗配套;热力层使用可辨认的数值渐变并保留图例,分类散点使用分类色,告警点使用语义色及文字或符号。深色方向须已确认,且同时配套浅色文字、轴线、图例、提示框和控件弹层,不能只换黑色背景。
31
+
32
+ 显式原生 DataV 大屏按[原生主题配置](../../yida-datav/references/components-and-configuration.md#主题与应用一致)执行:编辑器独立加载,应用 CSS 不代表原生大屏已换肤。按共享颜色角色在原生设计器中配置,并分别验收。
33
+
26
34
  ## 信息层级与验收
27
35
 
28
36
  KPI 数字使用等宽数字,标题、数值、单位和同比保持层级;按阅读距离与容器宽度安排字号及留白,不因“大屏”自动增加发光、渐变和装饰。表面可以有主次差异,但必须符合项目设计;不要求每张卡片完全同色。
@@ -0,0 +1,81 @@
1
+ ---
2
+ name: yida-datav
3
+ description: 仅在用户明确要求宜搭原生数字大屏、原生数据大屏或 DataV 大屏时使用。创建、复制和编辑前读取当前应用主题,配置配套的明暗与组件样式;查询模板、组件参数和图层配置,回读状态、改名和显式发布。普通大屏默认使用自定义页面。
4
+ ---
5
+
6
+ # 宜搭原生 DataV 大屏
7
+
8
+ ## 适用范围
9
+
10
+ - 用户明确要求宜搭原生大屏或 DataV 大屏时使用;一般数字大屏、数据大屏、驾驶舱和投屏监控由 `yida-dashboard` 组织内容,并用 `yida-canvas-custom-page` 承载。
11
+ - 继续已有原生大屏时使用其真实 `appType` 和 `formUuid`。先读取状态,确认 `formType=datav`。原生大屏通常返回 `DATAV-...` 编号,后续命令原样使用该编号。
12
+ - 平台权益、额度和企业数据授权沿用用户现有设置;CLI 不代用户开通权益或授权 DataV 访问企业数据。平台拒绝时反馈其错误及错误码。
13
+
14
+ ## 创建、复制或编辑前:读取应用主题
15
+
16
+ 先执行以下只读快照,再按[主题与应用一致](references/components-and-configuration.md#主题与应用一致)确定大屏配色。完整应用搭建与单独编辑大屏都执行此步骤;同轮已取得且应用主题未变化的快照直接复用。
17
+
18
+ ```bash
19
+ openyida app-theme snapshot <appType> --output-dir <新的本地目录> --json
20
+ ```
21
+
22
+ - 结合快照、当前应用工作台和已确认设计核对主色、导航与内容区明暗、文字及面板角色。`app-settings --section theme` 可能仅返回设置入口,不能据此认定主题已读取。
23
+ - 默认沿用当前应用:浅色应用使用浅色画布和面板,深色应用使用配套深色;用户明确要求独立投屏风格时采用该方向并保留应用品牌色。导航为浅色时一并检查大屏衔接,不能因模板默认深色就照搬深色。
24
+ - 新应用先等待本轮应用主题确定并读回,再适配大屏样式;已有应用不因搭建大屏而修改应用主题。主题未知时先核实,数据和组件检查可以继续,不猜主题或自动换肤。
25
+ - 编辑前读取 `datav config`,保留原有数据源、字段映射、蓝图、筛选、图层父子关系和权限;纯配色修改只调整已核实的样式字段及必要装饰。复制后也要重新检查模板样式,不能把复制成功当作主题适配完成。
26
+
27
+ ## 查询模板和创建
28
+
29
+ ```bash
30
+ openyida datav templates <appType> --page 1 --page-size 10 --json
31
+ openyida datav create <appType> "运营数字大屏" --template <templateId> --wait-seconds 15 --json
32
+ openyida datav inspect <appType> <formUuid> --json
33
+ ```
34
+
35
+ 模板编号来自 `templates` 返回的 `templateId`;分页参数以 1 开始。省略 `--template` 时由平台创建默认大屏,不猜模板编号。创建名称可用 `--locale zh_CN|en_US|ja_JP` 指定内容语言。
36
+
37
+ 创建是异步操作。`create` 默认最多等待 15 秒,`--wait-seconds` 可设为 0–60 秒。超时返回 `DATAV_CREATE_PENDING`、已创建的 `formUuid` 和 `recovery`;后续只用 `inspect` 查询同一个资源,不能再次创建。创建请求结果不确定或返回缺少编号时,用 `list-forms` 核对应用已有页面后再判断,不能自动重试。
38
+
39
+ `inspect` 返回 `state=ready|pending`、`datavId`、`designerUrl` 和 `previewUrl`;`pending` 可能是尚未初始化完成,不能直接认定创建失败。入口使用宜搭域名,不导出 DataV 分享 Token。
40
+
41
+ ## 复制和改名
42
+
43
+ ```bash
44
+ openyida datav copy <appType> <formUuid> "运营数字大屏副本" --wait-seconds 15 --json
45
+ openyida datav rename <appType> <formUuid> "经营驾驶舱" --json
46
+ ```
47
+
48
+ 复制仅在同一应用内进行,返回新资源编号;源大屏必须已就绪。复制超时按新编号继续查询,保留源资源。改名前回读真实 DataV 编号,不要求用户手填 `datavId`;改名后核对标题。`--locale` 改动目标语言标题,同时按平台约定更新 `zh_CN` 作为 DataV 底层名称,其余语言保留。
49
+
50
+ ## 配置和发布
51
+
52
+ 1. 先读取[组件与配置指南](references/components-and-configuration.md),根据目标查询图表、BI 分析、地图、信息、表格、控件或媒体的实际目录:
53
+
54
+ ```bash
55
+ openyida datav components <appType> <formUuid> --category analysis --json
56
+ openyida datav components <appType> <formUuid> --component bar-basic --json
57
+ openyida datav config <appType> <formUuid> --json
58
+ openyida datav config <appType> <formUuid> --component "<实际图层ID>" --json
59
+ ```
60
+
61
+ `components --component` 使用目录组件名,返回参数类型、范围、选项、默认值和数据/事件定义;`config --component` 使用保存图层的真实 ID,返回当前样式。先核对组件版本。目录可见不代表企业拥有权益或已安装商业组件包,返回 `entitlementVerified=false`。配置查询排除数据值与分享设置,不是完整备份。
62
+
63
+ 组件选型覆盖图表、地图、BI、指标、表格和控件,具体字段及交互按指南查询当前版本。交付时区分目录可见、权益确认、配置已保存和运行已验收;目录总数包含不同版本资产、地图子层和工具项,不能当作已实测组件数。
64
+
65
+ 2. 按前置主题决策,将画布、面板、图表、地图、控件和浮层的颜色角色配套。浅色适配同时处理深色背景图、装饰边框、背景柱、文字和浮层,不能只改画布底色。打开回读的 `designerUrl`,按实际版本在原生设计器内配置样式、地图子层、数据源与字段映射,以及蓝图中的筛选联动。当前 CLI 对组件配置提供查询,不提供组件、数据源或蓝图写入;应用主题 CSS 不会被 CLI 自动同步为 DataV 组件配置。
66
+
67
+ 支持配置浅色样式,不代表当前宜搭环境提供内置浅色主题系列或全局一键切换;按指南的[主题能力核验](references/components-and-configuration.md#主题能力核验)检查模板与设计器真实入口,不把模板默认深色当作能力限制。
68
+
69
+ 3. 保存后用 `config` 核对样式;在应用工作台中连同导航检查整页搭配,并在预览检查数据、指标口径、地图位置和控件联动。样式读回和视觉验收分别记录;缺少实际画面时保留视觉待验收状态。用户明确要求发布、启用大屏时执行:
70
+
71
+ ```bash
72
+ openyida datav publish <appType> <formUuid> --confirm --json
73
+ ```
74
+
75
+ `publish --confirm` 调用平台 `saveScreen` 接口,实际会发布并启用大屏,保留平台的 Token 和人员权限校验;不能把它当作保存草稿。不接受布局 JSON,不自动配置公开分享。返回 `publishAccepted=true`、`enableRequested=true` 表示平台接受了发布启用操作;`layoutVerified=false`、`readbackVerified=false` 保留内容验收缺口。在 `previewUrl` 验证布局、真实数据、交互和投屏效果后,再反馈完成结果。
76
+
77
+ ## 交付与恢复
78
+
79
+ - 返回资源名称、真实编号和本轮需要的设计器/预览入口;只操作单个大屏时保持单资源交付。
80
+ - 写入请求只发一次。网络异常或回读不匹配时保留 `appType`、`formUuid`、`retrySafe=false` 和恢复命令,先查询现状,不重复写入。
81
+ - 不自动删除大屏,不发起公开分享,不因创建资源而启动发布、启用或发送。
@@ -0,0 +1,187 @@
1
+ # 原生大屏组件与配置
2
+
3
+ ## 先查询当前环境
4
+
5
+ 普通数字大屏默认由 `yida-dashboard` 配合 Canvas 自定义页面搭建;本指南用于用户明确选择宜搭原生 DataV 的场景。宜搭嵌入版经过裁剪,不能用阿里云完整版的组件目录推断企业已拥有全部组件。
6
+
7
+ ```bash
8
+ openyida datav inspect <appType> <formUuid> --json
9
+ openyida datav components <appType> <formUuid> --json
10
+ openyida datav components <appType> <formUuid> --category analysis --json
11
+ openyida datav components <appType> <formUuid> --search "飞线" --json
12
+ openyida datav components <appType> <formUuid> --component bar-basic --json
13
+ openyida datav config <appType> <formUuid> --json
14
+ openyida datav config <appType> <formUuid> --component "<实际图层ID>" --json
15
+ ```
16
+
17
+ 两个查询都先验证目标应用、原生资源类型及就绪状态,沿宜搭设计器获取临时 DataV 会话。会话只保存在当前进程内存中。
18
+
19
+ | 查询 | 输入标识 | 返回内容 | 如何使用 |
20
+ | --- | --- | --- | --- |
21
+ | `components` | 应用与大屏编号 | 目录中的 `name`、`title`、`version`、`categories`、接口名称 | 先选类别,再用真实 `name` 查询参数 |
22
+ | `components --component` | 目录中的 `name`,如 `bar-basic` | `parameterDefinitions` 和完整 `definition` | 核对类型、范围、选项、默认值、显示条件、数据和事件协议 |
23
+ | `config` | 应用与大屏编号 | `page` 和 `scenes[].layers[]` | 找到当前使用的组件及版本、父子关系和图层 ID |
24
+ | `config --component` | 保存配置中的图层 `id` | 该图层的 `attr`、`config`、`dataInterfaces` | 对照实际样式和接口名称;不是目录组件名 |
25
+
26
+ `components` 的类别可选 `chart`、`analysis`、`map`、`info`、`table`、`control`、`media`、`other`。类别根据目录类型标签及地图组件名称归类,原始 `type` 同时保留;它不等同于设计器的资产包菜单。一个组件可以属于多个类别,例如柱状图同时属于图表和 BI 分析。筛选组合为交集;`--search` 匹配组件名和中文名。
27
+
28
+ 目录来自 DataV 组件服务,不包含另行安装的商业组件包。`entitlementVerified=false`、`installedPackagesIncluded=false` 表示目录可见不等于权益可用,也不代表已在当前大屏使用。添加时以设计器显示的权限及平台返回为准。
29
+
30
+ 目录数量随环境变化,包含地图子层、不同版本资产及工具项;不要把某次查询总数写成固定支持数量或全部已实测数量。结果说明分别列出目录可见、企业权益已确认、目标图层已配置、实际渲染/交互已验收的范围。自定义页面的图表或地图验收,不能替代同名原生 DataV 组件验收。
31
+
32
+ 目录通常给出当前目录版本;已保存图层可能仍使用旧版本。先比较 `components` 的 `version` 与 `config` 图层的 `version`。版本不同时,在原生设计器中查看该图层对应版本的参数,不直接把新版本参数套到旧图层。
33
+
34
+ ## 配置项怎么读
35
+
36
+ `components --component` 的每个 `parameterDefinitions` 条目提供实际 schema 路径以及平台定义中存在的 `name`、`type`、`default`、`min`、`max`、`range`、`options`、`show`、`showInPanel`。缺失默认值或范围时保持未指定,不猜数值。
37
+
38
+ 完整定义中的关键字段:
39
+
40
+ | 字段 | 含义 |
41
+ | --- | --- |
42
+ | `definition.config` | 样式面板 schema;不同协议版本可能采用直接分组或 `options.children` 菜单结构 |
43
+ | `definition.view` | 默认尺寸、最小尺寸等视图元信息 |
44
+ | `definition.apis` | 组件的数据接口;每个接口包含字段、类型、`optional`、处理器等 |
45
+ | `definition.events` | 组件会向外触发的事件及字段 |
46
+ | `definition.publicHandler` | 蓝图可调用的动作,如显示、隐藏、选择、高亮、设置视图 |
47
+ | `definition.children` | 地图等容器支持的子组件类型或名称 |
48
+ | `definition.analysis` | BI 分析入口、使用哪个数据接口及分析配置能力 |
49
+
50
+ 查询结果是参数说明,不是可提交的配置模板。`parameterDefinitions.path` 描述 schema 的结构;写入路径和保存值应以当前版本保存协议为准。
51
+
52
+ `config` 仅返回读取所需的页面和图层样式,省略数据值、分享设置、访问 Token,并对配置中凭据字段及 URL 中敏感参数脱敏。它不是完整备份、迁移或导入格式。
53
+
54
+ ## 支持的组件类别与选择
55
+
56
+ 下表用于选型;具体名称、版本和参数从 CLI 目录查询。官方 DataV 目录中的能力可能受到宜搭裁剪、企业权益、组件包或版本限制。
57
+
58
+ | 类别 | 常见组件 | 配置重点 | 数据准备 |
59
+ | --- | --- | --- | --- |
60
+ | 基础图表 `chart` | 柱状、分组/堆叠柱条、折线、区域、饼环、散点、气泡、雷达、瀑布、漏斗、仪表盘、词云、矩形树图、旭日图、关系图 | 坐标轴、图例、系列、标签、配色、动画、提示框 | 分类/时间、数值、系列字段;先确定聚合粒度 |
61
+ | BI 分析 `analysis` | 支持分析配置的柱状、折线、区域、百分比柱/条、区间柱、瀑布、对称条、气泡、漏斗、词云、仪表盘、热力、分类玫瑰、雷达、玉珏图、矩形树图 | 维度、度量、聚合、排序、筛选、数值格式;根据组件的 `analysis` 定义配置 | 数据集真实字段;确认求和、计数或去重口径 |
62
+ | 地图 `map` | 基础平面地图、地图容器与区域热力、飞线、呼吸气泡、散点、文字/轮播标签、轨迹、下钻等子层 | 地图版本、中心点、缩放、底图、图层顺序、子组件及交互 | 经纬度、区域 ID、GeoJSON 边界或起终点 |
63
+ | 信息 `info` | 通用标题、数字翻牌器、业务指标趋势、倒计时、跑马灯、多行文本、二维码、状态卡片、时间器 | 字体、颜色、单位、精度、对齐、滚动/翻牌动画 | 单值或有明确结构的记录,不把明细列表直接当 KPI |
64
+ | 表格 `table` | 轮播列表、键值表格、轮播列表柱状图、交叉透视表、进度条表格 | 列、行高、表头、序号、排序、分页/轮播、空值 | 稳定排序的明细或聚合结果;字段与列一一对应 |
65
+ | 控件 `control` | Tab 列表、全屏切换、iframe、轮播页面等;按钮、输入、下拉/多选、时间范围、级联、滑块、分页和导航按当前目录逐项确认 | 选项、默认值、选中样式、事件输出和目标动作 | 选项 ID 与显示文本;筛选参数类型须与目标一致 |
66
+ | 媒体 `media` | 图片、轮播图、视频、音频、流播放器、图标、色块、边框、装饰 | 资源地址、比例、裁切、层级、播放方式 | 可访问的 HTTPS 资源,按浏览器实际播放能力验收 |
67
+ | 其他 `other` | 目录中未归入上述类别的资产 | 通过 `--component` 查看实际定义 | 按该组件的数据接口准备 |
68
+
69
+ DataV 的 BI 分析组件、宜搭原生报表、Canvas 中的图表是不同配置体系。不要把 ECharts `option`、Recharts JSX 或宜搭报表 schema 直接传给 DataV 组件。
70
+
71
+ ## 画布、布局和通用属性
72
+
73
+ 在原生设计器中,未选择组件时配置页面;选中组件后配置其样式、数据和交互。
74
+
75
+ - 画布:宽、高、背景颜色/图片、栅格间距、缩放展示模式。先确定投屏实际比例,再排版。
76
+ - 图层 `attr`:`x`、`y` 是左上角像素坐标,`w`、`h` 是像素尺寸;`deg` 为旋转角度,`opacity` 为 0–1 的透明度。当前组件可另外包含宽高锁定、水平/垂直翻转等属性。
77
+ - 容器:通过 `parent`、`children` 核对父子关系;地图子层不是独立地图。层级同时受父容器和图层顺序控制。
78
+ - 样式:按实际版本 schema 配置字体、颜色、轴线、间距、标签、动画;`showInPanel` 等条件会影响设置项显示。
79
+
80
+ 缩放模式的保存值可能是枚举数字。`config` 原样保留服务器值,不把未核实的数字自行解释为某个模式。应在设计器选择具名模式并在目标屏幕预览。
81
+
82
+ ## 主题与应用一致
83
+
84
+ 创建、复制及编辑前执行 `openyida app-theme snapshot <appType> --output-dir <新的本地目录> --json`,结合当前应用工作台、已有 CSS 和本轮已确认设计,核对主色、导航、画布、面板、文字、边界、圆角及密度。`app-settings --section theme` 可能只返回设置入口,不能替代主题快照。快照中的主题名称也不能替代运行画面的颜色核验;明暗未知时先核实,保留应用配置。
85
+
86
+ 默认沿用应用明暗:浅色应用搭配浅色大屏,深色应用搭配相应深色大屏。导航与内容区分别核对;浅色导航不是强制所有面板纯白的开关。用户明确指定独立投屏风格时按该方向做局部适配,仍保留应用品牌关系;不因“大屏”套固定蓝色或深色模板,不擅自更换应用主题。完整应用搭建先消费本轮已落地的应用主题,再适配原生大屏。
87
+
88
+ 编辑前读取当前配置及版本,保留数据源、字段映射、蓝图、筛选、图层结构、可见性和权限。普通配色调整不重建业务图层;确需隐藏深色装饰时逐层确认该图层只有装饰用途,不隐藏业务图表或交互控件。
89
+
90
+ | 对象 | 配置方式 |
91
+ | --- | --- |
92
+ | 画布与面板 | 对应应用画布、卡片和边界角色;模板背景图片、纹理和装饰也要检查是否搭配 |
93
+ | KPI、图表与 BI | 数字和单位保持应用文字层级;分类系列按业务 ID 稳定配色,同一对象跨图同色,不把所有系列染成主色 |
94
+ | 地图 | 底图、边界、地名与画布明暗配套;数值热力用连续渐变和图例,分类点与告警点分别保留分类色、状态色 |
95
+ | 筛选、Tab 和按钮 | 普通、选中、悬停、焦点和禁用成组搭配;选中文字与选中底色保持区分 |
96
+ | 图例、轴线与浮层 | 配套正文、辅助文字、弱分割线及浮层表面;同时检查提示框、下拉和空/载/错态 |
97
+
98
+ 原生 DataV 是独立编辑器和渲染页面。应用主题上传成功不代表大屏组件已继承 CSS 变量;`datav config` 返回的是保存值,也不证明画布实际生效。先读取 `components --component` 的当前参数定义,再在原生设计器中按颜色角色填写该版本支持的具体值;需要具体颜色时解析应用变量,不直接填写未经验证的 CSS `var(...)`。
99
+
100
+ ### 主题能力核验
101
+
102
+ 画布背景颜色、背景图片和组件样式可用于搭建浅色大屏;这与“内置浅色主题系列”及“全局一键切换”是不同能力。先用 `datav templates` 查看当前应用可选模板,再在实际原生设计器核对主题入口及适用范围。模板没有明暗标签时,查看其预览及创建后的画布、背景图与组件样式;不从模板名称猜明暗,也不把模板默认深色解释成只能做深色。
103
+
104
+ 没有确认主题系列或全局切换入口时,说明当前需按组件配置浅色样式。不能因为某个阿里云完整版或其他版本有主题功能,就声称宜搭嵌入版也具备该入口;当前 CLI 没有一键浅色主题切换或自动跟随应用主题的命令。
105
+
106
+ ### 浅色适配顺序
107
+
108
+ 1. 画布先使用应用对应的浅色表面,检查并移除或替换不搭配的深色背景图片、纹理和纯装饰边框;白色卡片与浅色画布保留层级。
109
+ 2. 图表按正文、辅助文字和边界角色配置标题、单位、标签、轴线、图例及提示框;检查柱状图的背景柱、环图剩余轨道、折线面积和表格行底色,避免残留深色块或白色文字。
110
+ 3. 地图将未映射区域、边界、地名和标签浮层改为浅色环境可读的组合;热力仍用连续色带,分类点、飞线与告警点保持业务语义。地图容器和子图层分别核对。
111
+ 4. Tab、时间控件、按钮和下拉同时配置普通、选中、悬停、焦点、禁用及展开浮层,不用深色模板的默认控件背景搭配浅色画布。
112
+ 5. 保存后重新查询画布及所改图层;在应用工作台与预览分别检查导航衔接、整页、文字对比、地图、图例、浮层及筛选前后状态。截图需包含完整目标内容。
113
+
114
+ 模板配色和已保存样式逐项核对,保留地图地理语义及告警、成功、失败的业务语义,不按相同色值全局替换。更换应用主题后重新检查原生大屏并同步所需配置;当前 CLI 不自动进行该同步,也不为配色自动发布启用。
115
+
116
+ 在本轮已有设计或执行记录中保留应用主题来源、大屏明暗选择、变更图层、样式回读和视觉验收结果;不额外要求创建整应用方案文件。没有实际渲染证据时将视觉验收标为待验证;没有数据或交互操作证据时不声称联动通过。自定义页面的主题接入按[看板主题规则](../../yida-dashboard/references/theme-presets.md)执行。
117
+
118
+ ## 图表、指标和 BI 配置
119
+
120
+ 1. 先用 `config` 确认当前图层组件名和版本,用 `components --component` 查数据接口与参数。
121
+ 2. 在组件右侧的“数据”面板选择“配置数据源”,选宜搭数据源并进入配置。
122
+ 3. 选择实际数据集,将真实字段拖到图表的维度、度量或对应接口字段中;指定聚合、排序、筛选和返回条数。
123
+ 4. 用预览核对总量、时间粒度、系列和空值;再调整样式。时间轴输入需符合组件要求的时间格式,显示格式另行配置。
124
+ 5. 根据 `definition.events`、`publicHandler` 配置交互;缺少某动作时不编造事件名。
125
+
126
+ 当前目录中可查询的字段示例(使用前核对返回版本):
127
+
128
+ | 组件名 | 接口/字段 | 配置说明 |
129
+ | --- | --- | --- |
130
+ | `bar-basic` 柱状图 | `source.x` 分类字符串、`source.y` 数值;`colorField` 和 `trace` 为可选字段 | 分类字段映射 X,聚合数值映射 Y;按需用颜色字段或拆分字段细分数据 |
131
+ | `ml-line-basic` 折线图 | `source.x`、`source.y`、可选 `colorField` | 确认 X 的时间/类目类型和顺序,再配系列与提示框 |
132
+ | `pie-ranking` 轮播饼图 | `source.type`、`source.value` | 分类与数值;轮播规则属于该组件配置,不等同普通饼图 |
133
+ | `number-title-flop` 数字翻牌器 | `source.value` 数值;可选 `name`、`prefix`、`suffix` | 先聚合成期望 KPI,前后缀表示货币/单位,不改变数值口径 |
134
+ | `main-title` 通用标题 | 查 `definition.apis.source.fields`;样式可有标题内容及链接配置 | 静态标题和数据标题都可存在,最终显示受当前绑定影响 |
135
+
136
+ 例如 `bar-basic` 的 5.9.10 版本使用 `itemSelect` 输出数据项选择、`legendSelect` 输出图例选择,支持 `highlight` 高亮与 `reset` 重置选择;开启扫光动画时部分事件或动作受限。旧图层未必使用该版本,先核对当前定义,不把这些事件直接套到所有柱图。矩形树图 `ml-treemap`、旭日图 `ml-sunburst` 等也先按真实组件名查询各自定义,不能复用柱图字段协议。
137
+
138
+ 宜搭数据集可涵盖跨应用、子表、视图表、数据准备和外部数据源;是否可选取决于当前环境及权限。外部 API、数据库等完整 DataV 数据源能力要在宜搭嵌入版实际确认,不因官方完整版有文档就声称 CLI 已接入。
139
+
140
+ ## 地图和子图层
141
+
142
+ 先确认地图类型与版本,再添加它支持的子层:选择地图 → 数据面板 → 子组件管理 → 添加目标子层 → 进入该子层设置。不可混用 1.x、2.x、3D 平面地图的子组件和字段。
143
+
144
+ | 地图内容 | 配置入口 | 数据及关键约束 |
145
+ | --- | --- | --- |
146
+ | 地图容器 | 中心、缩放、底图、拖拽/滚轮/交互 | 经度通常在 -180–180、纬度在 -90–90;以该版本 schema 的实际范围为准 |
147
+ | 区域热力 | 区域边界、填色、描边、标注、色带、事件 | 边界 GeoJSON 与业务区域 ID 必须匹配;地区名称不能直接代替未映射的行政 ID |
148
+ | 呼吸气泡/散点 | 坐标、尺寸映射、颜色、动画、类型 | 经纬度必须为数值;核实坐标系,避免经纬度对调 |
149
+ | 飞线 | 起点、终点、频率、速度、曲线和样式 | 先查看接口要求是坐标字符串、名称还是经纬度字段,不能通用套格式 |
150
+ | 下钻/轮播标签 | 地区层级、事件、标签字段、轮播间隔 | 地区父子关系完整;选择事件与目标组件动作匹配 |
151
+ | 3D 地图/模型 | 查询目录并在设计器核对权益和子层 | 与基础平面地图分开配置;目录存在不代表该企业已启用 |
152
+
153
+ 旧版 `datavmap-2d` 的实际接口示例:`mapstate` 接受 `zoom`、`lng`、`lat`;其飞线子层 `datavmap-2d-layer-flyingline` 的 `source` 使用字符串 `from`、`to`;呼吸气泡层使用 `lng`、`lat`、`value`、`type`;区域热力层分别有 `geojson` 和 `data` 接口,业务数据包含 `area_id`、`value`、可选 `info`。这些是该组件版本的协议,不代表新版地图也采用相同结构。
154
+
155
+ 边界数据可通过官方 GeoAtlas 查询;生产地图应核对区域编码、边界版本及坐标系。地理信息、数值统计与目标地区有一项不匹配时先处理数据,再调整视觉。
156
+
157
+ ## 控件筛选和联动
158
+
159
+ 控件添加后不会自动成为业务筛选器。先查询事件/动作定义,再在蓝图中连接:
160
+
161
+ 1. 配置选项数据、默认选项和显示字段。
162
+ 2. 将控件和目标图表导出到蓝图,连接控件事件与目标的数据请求、选择、高亮或显示动作。
163
+ 3. 将选项 ID 映射到目标使用的参数,核对字符串、数字、时间或时间区间类型。
164
+ 4. 用至少两个不同选项以及清空/重置动作检查数据确实变化。
165
+
166
+ 例如目录中的 `tab-list` 数据接口为 `source`,字段包含 `id`、`content`、`imgSrc`;事件 `handleClick` 与动作 `select`、`autoCarousel`、`closeAutoCarousel` 由该版本定义提供。不要把普通网页的 `onChange` 名称当作 DataV 蓝图事件。
167
+
168
+ ## CLI 与设计器操作边界
169
+
170
+ | 操作 | 使用方式 | 结果核对 |
171
+ | --- | --- | --- |
172
+ | 查模板、创建、复制、改名、查就绪状态 | `datav templates/create/copy/rename/inspect` | 查资源真实编号、标题和就绪状态 |
173
+ | 查组件种类、参数、接口及事件定义 | `datav components` | 核对名称、版本、分类和字段类型 |
174
+ | 查画布与现有图层样式 | `datav config` | 核对尺寸、位置、父子关系、组件版本及保存值 |
175
+ | 添加/删除组件、保存样式、配置数据源与蓝图 | 当前使用原生设计器 | 保存后再次执行 `config` 并在预览核对数据与交互 |
176
+ | 明确发布启用 | `datav publish --confirm` | CLI 受理回执后,再检查访问和显示 |
177
+ | 一般自定义大屏 | Canvas 编写与 `publish` 自定义页面命令 | 编译、页面回读、浏览器内容和交互 |
178
+
179
+ 当前 CLI 未提供组件配置写入命令。DataV 编辑器使用独立的组件、数据源、蓝图保存协议,宜搭 `datav publish` 只触发发布启用;不能把组件配置 JSON 塞进该命令,也不能用整屏旧快照覆盖最新内容。需要确定性全代码布局、交互或自定义图表时,按默认规则选择 Canvas 自定义页面。
180
+
181
+ ## 官方说明
182
+
183
+ - [宜搭大屏设计简介](https://docs.aliwork.com/docs/yida_support/_7/vvgk1m):宜搭适配、数据源、地图飞线与访问限制。页面存在不同时期的权限说明,以当前平台校验和实际访问为准。
184
+ - [宜搭模板大屏配置](https://help.aliyun.com/zh/datav/datav-6-0/use-cases/use-a-template-to-create-a-datav-dashboard):组件数据源、字段映射及蓝图步骤。
185
+ - [组件通用配置](https://help.aliyun.com/zh/datav/datav-6-0/user-guide/configure-item-description):样式、数据和交互面板。
186
+ - [BI 分析组件](https://help.aliyun.com/zh/datav/datav-6-0/user-guide/bi-analysis-widgets/)、[图表组件](https://help.aliyun.com/zh/datav/datav-6-0/user-guide/charts/)、[控件](https://help.aliyun.com/zh/datav/datav-6-0/user-guide/control/)、[信息](https://help.aliyun.com/zh/datav/datav-6-0/user-guide/information-1/)、[表格](https://help.aliyun.com/zh/datav/datav-6-0/user-guide/table-1/)、[媒体](https://help.aliyun.com/zh/datav/datav-6-0/user-guide/media/):目录说明,使用前核对宜搭实际版本及权限。
187
+ - [地图子组件](https://help.aliyun.com/zh/datav/datav-6-0/user-guide/manage-child-widgets-of-a-map-widget):地图容器和子层关系。
@@ -95,6 +95,18 @@ Fast 与 Plan 使用下面同一套三方向生成规则和候选字段,不得
95
95
 
96
96
  主色优先采用用户要求、品牌和参考图中的依据。缺少明确依据时,结合使用环境和整体构图确定配色;业务类型用于判断任务和密度,具体颜色由本项目设计确定。已确认的主色可以保留,创意也可通过构图、层级和材质表达。
97
97
 
98
+ ## 主色与模板表面的协调
99
+
100
+ 选定命名主题后,读取索引 `templatePath` 的完整主题与 `cssTemplatePath` 的配对 CSS,核对实际画布、内容面、正文、导航选中态和控件强调色。主题名称只用于识别;冷暖、明暗和材质以模板内容为准。命令和样例文件中的主题与色值只说明输入格式,Fast、Plan 均按当前任务的选择填入。
101
+
102
+ `--primary-color` 和品牌 token 不会自动重配所有固定色值。品牌色阶更新与整套配色协调分别检查:
103
+
104
+ - 用户未指定主色且模板配色符合任务时,可沿用模板中的协调色并说明依据,无需再套通用商务蓝。
105
+ - 用户指定主色时保留其要求,对照背景、正文、边框、导航选中与控件状态成组调整必要 token,保留已选风格的结构和材质。Fast 使用 `--tokens-file` 的 `tokens` 对象,Plan 更新项目视觉 token;避免只改主按钮而遗留冲突的固定强调色。
106
+ - 冷暖混用可以作为有依据的设计,须明确大面积表面与局部强调的分工。CLI 的文字对比度检查通过只证明对应可读性,不代表整体配色已协调;发布后仍检查原生表单、数据管理页与自定义页面的实际效果。
107
+
108
+ Fast 在当前任务上下文完成上述判断和交接,继续生成 CSS;不为此新增方案文件或默认确认步骤。
109
+
98
110
  ## 选择时展示名称与效果图
99
111
 
100
112
  确需选择时,所有环境统一使用 `ask_human` 收集风格选择,按当前宿主实际可用且当前模式允许的提问工具执行。默认只提供风格名称和一句适用说明。只有用户显式要求“给我一下相关预览”“给我一些可能的参考图”“看看这几种风格的效果”等,才生成并展示效果卡片、参考图片或预览链接。
@@ -52,8 +52,10 @@ description: 自定义页面 Recharts 高级图表技能。使用 `YidaCodeCanva
52
52
 
53
53
  ## 推荐实现结构
54
54
 
55
+ 先按[标准主题桥](../yida-canvas-custom-page/references/canvas-theme-provider.md)接入应用主题。下例采用脚本装配标记,合并业务后用真实主题 CSS 生成独立输出文件,再编译该输出;已有 Provider 时保留它,只替换业务部分。多业务系列使用项目分类色盘,目标参考线可用中性文字色和虚线区分。
56
+
55
57
  ```jsx
56
- import React, { useMemo, useState } from 'react';
58
+ /* @canvas-theme-provider */
57
59
  import { Segmented } from 'antd';
58
60
  import {
59
61
  Bar,
@@ -66,33 +68,38 @@ import {
66
68
  YAxis,
67
69
  } from 'recharts';
68
70
 
69
- function YidaComp(props) {
70
- const [windowSize, setWindowSize] = useState(7);
71
+ function PageContent(props) {
72
+ const { token } = useCanvasThemeContext();
73
+ const [windowSize, setWindowSize] = React.useState(7);
71
74
  const aggregatedRows = Array.isArray(props.aggregatedRows)
72
75
  ? props.aggregatedRows
73
76
  : [];
74
- const visibleRows = useMemo(
77
+ const visibleRows = React.useMemo(
75
78
  () => aggregatedRows.slice(-windowSize),
76
79
  [aggregatedRows, windowSize]
77
80
  );
78
81
 
79
82
  return (
80
- <div>
83
+ <div style={{ color: token.colorText, background: token.colorBgContainer }}>
81
84
  <Segmented value={windowSize} onChange={setWindowSize} options={[7, 30]} />
82
85
  <ResponsiveContainer width="100%" height={320}>
83
86
  <ComposedChart data={visibleRows}>
84
- <CartesianGrid strokeDasharray="3 3" />
85
- <XAxis dataKey="label" />
86
- <YAxis />
87
- <Tooltip />
88
- <Bar dataKey="amount" fill="#1677ff" />
89
- <Line dataKey="target" stroke="#fa8c16" />
87
+ <CartesianGrid stroke={token.colorBorderSecondary} strokeDasharray="3 3" />
88
+ <XAxis dataKey="label" tick={{ fill: token.colorTextSecondary }} stroke={token.colorBorder} />
89
+ <YAxis tick={{ fill: token.colorTextSecondary }} stroke={token.colorBorder} />
90
+ <Tooltip contentStyle={{ background: token.colorBgElevated, color: token.colorText, borderColor: token.colorBorder }} />
91
+ <Bar dataKey="amount" fill={token.colorPrimary} />
92
+ <Line dataKey="target" stroke={token.colorTextSecondary} strokeDasharray="4 4" />
90
93
  </ComposedChart>
91
94
  </ResponsiveContainer>
92
95
  </div>
93
96
  );
94
97
  }
95
98
 
99
+ function YidaComp(props) {
100
+ return <CanvasThemeProvider><PageContent {...props} /></CanvasThemeProvider>;
101
+ }
102
+
96
103
  export default YidaComp;
97
104
  ```
98
105
 
@@ -121,6 +128,7 @@ openyida publish project/pages/src/trend-combo.canvas.jsx <appType> <displayPage
121
128
  - [ ] 筛选控件受控,并真正改变展示数据或请求参数。
122
129
  - [ ] loading、空态、错误态、无权限状态可区分。
123
130
  - [ ] 响应式容器有明确高度,Tooltip、坐标轴和图例可读。
131
+ - [ ] 控件、图表和浮层消费应用主题;分类色与状态色分开,换主题后轴线、图例、提示框和选中态仍可读。未实测换肤时不声明主题验收通过。
124
132
  - [ ] seed 数据有可见标识;真实交付不把 seed 当真实数据。
125
133
  - [ ] 只有真实 `publish` 成功后才声明页面已发布。
126
134
 
@@ -1110,7 +1110,7 @@
1110
1110
  "name": "yida-dashboard",
1111
1111
  "path": "skills/yida-dashboard/SKILL.md",
1112
1112
  "display_name": "经营看板产品化交付",
1113
- "description": "经营分析看板、驾驶舱和数据大屏交付,用于指标判断、趋势分析和投屏监控;普通待办工作台、操作队列和办事门户使用自定义页面技能。",
1113
+ "description": "经营分析看板、驾驶舱、数字大屏和数据大屏交付,用于指标判断、趋势分析和投屏监控,默认使用自定义页面承载;仅在用户明确要求宜搭原生大屏时选择原生承载。普通待办工作台、操作队列和办事门户使用自定义页面技能。",
1114
1114
  "category": "yida-skills/analytics",
1115
1115
  "tags": [
1116
1116
  "看板",
@@ -1870,6 +1870,42 @@
1870
1870
  "feedback"
1871
1871
  ],
1872
1872
  "requires_login": false
1873
+ },
1874
+ {
1875
+ "name": "yida-datav",
1876
+ "path": "skills/yida-datav/SKILL.md",
1877
+ "display_name": "宜搭原生大屏",
1878
+ "description": "仅显式宜搭原生数字大屏、原生数据大屏或 DataV 大屏时使用:模板、组件目录与参数、图层配置查询,异步创建、复制、状态回读、改名和发布。普通大屏使用自定义页面。",
1879
+ "category": "yida-skills/analytics",
1880
+ "tags": [
1881
+ "原生大屏",
1882
+ "DataV"
1883
+ ],
1884
+ "aliases": [
1885
+ "宜搭原生数字大屏",
1886
+ "原生数据大屏",
1887
+ "DataV 大屏"
1888
+ ],
1889
+ "positive_signals": [
1890
+ "宜搭原生大屏",
1891
+ "DataV 大屏",
1892
+ "原生数字大屏"
1893
+ ],
1894
+ "negative_signals": [
1895
+ "普通数字大屏",
1896
+ "自定义大屏",
1897
+ "自定义页面",
1898
+ "经营看板"
1899
+ ],
1900
+ "command_ids": [
1901
+ "datav.templates",
1902
+ "datav.create",
1903
+ "datav.inspect",
1904
+ "datav.copy",
1905
+ "datav.rename",
1906
+ "datav.publish"
1907
+ ],
1908
+ "done_when": "原生大屏资源状态、设计器和预览入口已回读;布局与数据交互按实际预览结果验收。"
1873
1909
  }
1874
1910
  ],
1875
1911
  "route_groups": [