This commit is contained in:
Fine 2022-08-15 14:30:49 +08:00
parent 417e2627ed
commit c1f5c471ce
3 changed files with 21 additions and 7 deletions

View File

@ -35,4 +35,5 @@ export const TimeRangeConfig = {
backgroundColor: "white", backgroundColor: "white",
fontSize: 14, fontSize: 14,
textAlign: "center", textAlign: "center",
text: "text",
}; };

View File

@ -11,6 +11,15 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. --> limitations under the License. -->
<template> <template>
<div class="item">
<span class="label">{{ t("content") }}</span>
<el-input
class="input"
v-model="text"
size="small"
@change="changeConfig({ text })"
/>
</div>
<div class="item"> <div class="item">
<span class="label">{{ t("textAlign") }}</span> <span class="label">{{ t("textAlign") }}</span>
<Selector <Selector
@ -79,6 +88,7 @@ const backgroundColor = ref(graph.backgroundColor || "green");
const fontColor = ref(graph.fontColor || "white"); const fontColor = ref(graph.fontColor || "white");
const fontSize = ref<number>(graph.fontSize || 12); const fontSize = ref<number>(graph.fontSize || 12);
const textAlign = ref(graph.textAlign || "left"); const textAlign = ref(graph.textAlign || "left");
const text = ref<string>(graph.text || "");
const Colors = [ const Colors = [
{ {
label: "Green", label: "Green",

View File

@ -39,22 +39,25 @@ limitations under the License. -->
:style="{ :style="{
backgroundColor: TextColors[graph.backgroundColor], backgroundColor: TextColors[graph.backgroundColor],
justifyContent: graph.textAlign, justifyContent: graph.textAlign,
color: TextColors[graph.fontColor],
}" }"
> >
<Icon <Icon iconName="time_range" size="lg" />
iconName="time_range"
size="lg"
:style="{ color: TextColors[graph.fontColor] }"
/>
<span <span
class="ml-10" class="ml-5"
:style="{ :style="{
color: TextColors[graph.fontColor],
fontSize: graph.fontSize + 'px', fontSize: graph.fontSize + 'px',
}" }"
> >
{{ content }} {{ content }}
</span> </span>
<span
class="ml-5"
:style="{
fontSize: graph.fontSize + 'px',
}"
>{{ graph.text }}</span
>
</div> </div>
</div> </div>
</template> </template>