Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 #268 fixed bug: use select when update ci img #278

Merged
merged 1 commit into from
Oct 8, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 26 additions & 51 deletions cmdb-ui/src/pages/admin/cmdb-model-management.vue
Original file line number Diff line number Diff line change
Expand Up @@ -179,27 +179,29 @@
></Input>
</FormItem>
<FormItem label="图标">
<img
:src="item.form.imgSource + '.png'"
style="width:58px;height:58px"
/>
<Upload
v-if="item.form.status !== 'decommissioned'"
ref="upload"
:on-success="handleUploadImgSuccess"
:show-upload-list="false"
accept=".png"
:max-size="100"
:on-exceeded-size="handleMaxSize"
type="drag"
:action="item.form.imgUploadURL || ''"
:headers="setUploadActionHeader"
style="display: inline-block;width:58px;"
>
<div style="width: 58px;height:58px;line-height: 58px;">
<Icon type="ios-camera" size="20"></Icon>
</div>
</Upload>
<Select v-model="item.form.imageFileId">
<img
v-if="item.form.imageFileId"
:src="`/cmdb/ui/v2/files/${item.form.imageFileId}.png`"
slot="prefix"
height="24"
width="24"
style="margin-top:2px;"
/>
<Option
v-for="(item, i) in imgs"
:key="i + 1"
:value="i + 1"
>
<img
slot
:src="`/cmdb/ui/v2/files/${i + 1}.png`"
width="30"
height="30"
/>
&nbsp;
</Option>
</Select>
</FormItem>
<FormItem>
<Button
Expand Down Expand Up @@ -263,10 +265,10 @@
height="24"
width="24"
/>
<Option v-for="i in imgs" :key="i" :value="i">
<Option v-for="(item, i) in imgs" :key="i + 1" :value="i + 1">
<img
slot
:src="`/cmdb/ui/v2/files/${i}.png`"
:src="`/cmdb/ui/v2/files/${i + 1}.png`"
width="30"
height="30"
/>
Expand Down Expand Up @@ -982,34 +984,7 @@ export default {
},
data() {
return {
imgs: [
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15,
16,
17,
18,
19,
20,
21,
22,
23,
24,
25,
26
],
imgs: new Array(26),
source: {},
layers: [],
graph: {},
Expand Down
6 changes: 4 additions & 2 deletions cmdb-ui/src/pages/designing/ci-data.vue
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ export default {
},
source: {},
layers: [],
graph: {}
graph: {},
ciTypesName: {}
};
},
computed: {
Expand Down Expand Up @@ -156,6 +157,7 @@ export default {
this.source.forEach(_ => {
_.ciTypes &&
_.ciTypes.forEach(async i => {
this.ciTypesName[i.ciTypeId] = i.name;
let imgFileSource =
i.imageFileId === 0 || i.imageFileId === undefined
? defaultCiTypePNG.substring(0, defaultCiTypePNG.length - 4)
Expand Down Expand Up @@ -654,7 +656,7 @@ export default {
});
if (status === "OK") {
this.$refs[this.tableRef][0].export({
filename: "Ci Data",
filename: this.ciTypesName[this.currentTab],
data: formatData(data.contents.map(_ => _.data))
});
}
Expand Down