Commit ecb888ac authored by rockyl's avatar rockyl

修复星速台编辑皮肤的一些bug

parent 7a338bac
......@@ -30,11 +30,11 @@
</el-select>
<el-input v-model="name" size="small" class="name" placeholder="请输入皮肤名称"></el-input>
</div>&nbsp;
<el-popconfirm v-if="skinId" class="save-button" @onConfirm="clickSave" placement="top"
:title="$t('Click save will overwrite and apply immediately', {name: this.pxProjectName, skin: skinName})">
<el-popconfirm v-if="skinId || operate===0" class="save-button" @onConfirm="clickSave" placement="top"
:title="$t('Click save will overwrite and apply immediately', {name: this.pxProjectName, skin: operate===0 ? '' : skinName})">
<el-button slot="reference" type="primary" size="small">{{ $t("Save") }}</el-button>
</el-popconfirm>
<el-button v-if="skinId" size="small" @click="getUrl">获取链接</el-button>
<el-button v-if="skinId && operate!==0" size="small" @click="getUrl">获取链接</el-button>
</div>
</div>
</template>
......
......@@ -146,6 +146,9 @@
async onSaveSkin(skin, operate) {
try {
await this.saveSkin(skin, operate);
let oldSkin = this.skins.find(s=>s.id === skin.id);
oldSkin.name = skin.name;
oldSkin.html = skin.html;
this.$refs.pxSkinEditor.onSaveSuccess();
} catch (e) {
throw new Error(e.message);
......@@ -234,6 +237,7 @@
};
const {ret} = await playWaiting(saveSkins(data), this.$t('In processing'));
if (ret.success !== false) {
this.$message({
message: this.$t('Operate success'),
type: "success"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment