mirror of
https://github.com/nuintun/command-manager.git
synced 2025-06-08 12:14:03 +08:00
update files
This commit is contained in:
parent
4608033522
commit
18027aa3ef
@ -18,7 +18,13 @@
|
|||||||
<div class="ui-popup-content">
|
<div class="ui-popup-content">
|
||||||
<form @submit.prevent="add">
|
<form @submit.prevent="add">
|
||||||
<ul>
|
<ul>
|
||||||
<li v-ref:base is="project-base" :name.sync="name" :path.sync="path" :unique="unique"></li>
|
<li
|
||||||
|
v-ref:base
|
||||||
|
is="project-base"
|
||||||
|
:origin-name.sync="name"
|
||||||
|
:path.sync="path"
|
||||||
|
:unique="unique">
|
||||||
|
</li>
|
||||||
<li class="ui-popup-control">
|
<li class="ui-popup-control">
|
||||||
<input type="submit" class="ui-button" value="确定"/>
|
<input type="submit" class="ui-button" value="确定"/>
|
||||||
<input @click.stop="hidePopup" type="button" class="ui-button ui-button-orange" value="取消"/>
|
<input @click.stop="hidePopup" type="button" class="ui-button ui-button-orange" value="取消"/>
|
||||||
|
@ -13,7 +13,12 @@ require('../directory');
|
|||||||
module.exports = Vue.component('project-base', {
|
module.exports = Vue.component('project-base', {
|
||||||
template: fs.readFileSync(path.join(__dirname, 'project-base.html')).toString(),
|
template: fs.readFileSync(path.join(__dirname, 'project-base.html')).toString(),
|
||||||
props: {
|
props: {
|
||||||
name: {
|
originName: {
|
||||||
|
type: String,
|
||||||
|
twoWay: true,
|
||||||
|
default: ''
|
||||||
|
},
|
||||||
|
path: {
|
||||||
type: String,
|
type: String,
|
||||||
twoWay: true,
|
twoWay: true,
|
||||||
default: ''
|
default: ''
|
||||||
@ -21,19 +26,20 @@ module.exports = Vue.component('project-base', {
|
|||||||
unique: {
|
unique: {
|
||||||
type: Object,
|
type: Object,
|
||||||
required: true
|
required: true
|
||||||
},
|
|
||||||
path: {
|
|
||||||
type: String,
|
|
||||||
twoWay: true,
|
|
||||||
default: ''
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data: function (){
|
data: function (){
|
||||||
return {
|
return {
|
||||||
|
name: this.originName,
|
||||||
nameError: '',
|
nameError: '',
|
||||||
pathError: ''
|
pathError: ''
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
watch: {
|
||||||
|
originName: function (name){
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
focus: function (key){
|
focus: function (key){
|
||||||
this[key] = '';
|
this[key] = '';
|
||||||
@ -43,10 +49,11 @@ module.exports = Vue.component('project-base', {
|
|||||||
this.path = this.path.trim();
|
this.path = this.path.trim();
|
||||||
|
|
||||||
if (this.name) {
|
if (this.name) {
|
||||||
if (this.unique[this.name]) {
|
if (this.originName && this.originName !== this.name && this.unique[this.name]) {
|
||||||
this.nameError = '项目已存在';
|
this.nameError = '项目已存在';
|
||||||
} else {
|
} else {
|
||||||
this.nameError = '';
|
this.nameError = '';
|
||||||
|
this.originName = this.name;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
this.nameError = '项目名称不能为空';
|
this.nameError = '项目名称不能为空';
|
||||||
|
@ -31,7 +31,7 @@ module.exports = Vue.component('project-configure', {
|
|||||||
},
|
},
|
||||||
data: function (){
|
data: function (){
|
||||||
return {
|
return {
|
||||||
clone: null
|
clone: util.clone(this.project)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
@ -71,8 +71,5 @@ module.exports = Vue.component('project-configure', {
|
|||||||
// clean
|
// clean
|
||||||
this.reset();
|
this.reset();
|
||||||
}
|
}
|
||||||
},
|
|
||||||
created: function (){
|
|
||||||
this.clone = util.clone(this.project);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
<li
|
<li
|
||||||
v-ref:base
|
v-ref:base
|
||||||
is="project-base"
|
is="project-base"
|
||||||
:name.sync="clone.name"
|
:origin-name.sync="clone.name"
|
||||||
:path.sync="clone.path"
|
:path.sync="clone.path"
|
||||||
:unique="unique">
|
:unique="unique">
|
||||||
</li>
|
</li>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user