提交 3d0208b3 authored 作者: caicai's avatar caicai

1

上级 a0b1b312
class cateWin {
constructor(mainWindow) {
this.mainWindow = mainWindow;
this.store = this.mainWindow.store;
//简约模式的窗口
this.webType = "simpleCate";
}
/* 窗口初始化跟随,mainwindow */
/* 新建分类窗口 */
createWin() {
this.mainWindow.createWindow({
x: 0,
y: 100,
width: JiJianModeW,
height: JiJianModeH,
webType: this.webType, //简约模式的窗口
})
}
/* 获取简约模式-所有分类的窗口 */
getAllWindows() {
let windowList = this.mainWindow.getAllWindows();
if(!windowList || windowList.length==0) return [];
let newWinList = windowList.filter(v => v.webContents.webType === this.webType);
return newWinList;
}
}
export default cateWin;
\ No newline at end of file
......@@ -44,8 +44,8 @@ class category {
if(name == undefined) return;
let categoryList = this.store.get(process.env.VUE_APP_CATENAME);
name = name.trim();
let hasIn = categoryList.findIndex(v => v.name == name);
if(hasIn != -1) return;
// let hasIn = categoryList.findIndex(v => v.name == name);
// if(hasIn != -1) return;
let category = {
name,
......
......@@ -171,10 +171,6 @@ class MainWindow {
if(args.x != undefined) opt.x = args.x;
if(args.y != undefined) opt.y = args.y;
if(args.backgroundColor != undefined) opt.backgroundColor = args.backgroundColor;
if(args.isMainWin) {
// opt.transparent = true;
// opt.backgroundColor = '#10000000'
}
console.log(opt)
let win = new BrowserWindow(opt)
......
......@@ -13,7 +13,7 @@
</div>
<img @click="delCate(cItem,cIndex)" src="~@/assets/close.png" alt="" class="dragbox_cate_del">
</div>
<el-input v-else v-model="editName" placeholder="" minlength="1" maxlength="6" @blur="closeEdit(cIndex)" class="dragbox_cate_input"></el-input>
<el-input v-else v-model="editName" placeholder="" maxlength="6" @blur="closeEdit(cIndex)" class="dragbox_cate_input"></el-input>
<div v-if="cItem.softList" class="dragbox_cate_list">
<cateItem v-for="(sItem, sIndex) in cItem.softList" :key="sIndex" :detail="sItem" :src="sItem.icon" :name="sItem.name"></cateItem>
</div>
......@@ -26,7 +26,7 @@
destroy-on-close
center>
<div style="padding-bottom:12px;fontsize:16px">请输入分类名称</div>
<el-input v-model="cateName" placeholder="请输入" minlength="1" maxlength="6"></el-input>
<el-input v-model="cateName" placeholder="请输入" maxlength="6"></el-input>
<span slot="footer" class="dialog-footer">
<el-button @click="cancelAdd">取 消</el-button>
<el-button type="primary" @click="sureAdd">确 定</el-button>
......@@ -163,13 +163,13 @@ export default {
closeEdit(index) {
let oldName = this.cateList[index].name;
let editName = this.editName.trim();
if(editName == '') editName = "未命名";
if(editName == '' || editName.length<1 || editName.length>6) {
this.$message.warning("分类名字1到6个字");
this.editName = "";
this.editIndex = -1;
return;
}
// if(editName == '') editName = "未命名";
if(oldName != editName) {
this.$emit( "changeName", {index,name:editName, detail:this.cateList[index]} );
}
......@@ -201,13 +201,16 @@ export default {
this.cateName = "";
},
sureAdd() {
console.log('sureAdd', this.cateName)
let name = this.cateName;
if(name == '' || name.trim() == '' || name.length<1 || name.length>6) {
if(name == '' || name.trim() == '') name = "未命名";
console.log(name)
if(name.length<1 || name.length>6) {
this.$message.warning("分类名字1到6个字");
this.cateName = "";
return;
}
// if(name == '' || name.trim() == '') name = "未命名";
console.log('addCategory',)
this.$emit("addCategory", name);
this.cateName = "";
},
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论