From 9b10146f484cab3000e1cca237c87c33e5306720 Mon Sep 17 00:00:00 2001 From: zq <136432190602163.com> Date: Thu, 27 Mar 2025 18:27:00 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AB=99=E7=82=B9=E5=88=97=E8=A1=A8=E5=B8=83?= =?UTF-8?q?=E5=B1=80=E5=8F=8A=E8=A1=A8=E6=A0=BC=E5=86=85=E5=B5=8C=E5=A5=97?= =?UTF-8?q?=E5=86=85=E5=AE=B9=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/assets/site/addIcon.svg | 1 + src/assets/site/dropdown_chose_ic.svg | 1 + src/assets/site/info_filled.svg | 1 + src/components/GuipDialog.vue | 7 +- src/components/GuipSelectFilter.vue | 185 +++++++++++++++++ src/router/index.js | 11 +- src/style/theme/common.scss | 28 ++- src/style/theme/index.css | 2 +- src/views/SiteList.vue | 363 +++++++++++++++++++++++++++++----- src/views/SiteSettings.vue | 49 ----- 10 files changed, 533 insertions(+), 115 deletions(-) create mode 100644 src/assets/site/addIcon.svg create mode 100644 src/assets/site/dropdown_chose_ic.svg create mode 100644 src/assets/site/info_filled.svg create mode 100644 src/components/GuipSelectFilter.vue delete mode 100644 src/views/SiteSettings.vue diff --git a/src/assets/site/addIcon.svg b/src/assets/site/addIcon.svg new file mode 100644 index 0000000..171300c --- /dev/null +++ b/src/assets/site/addIcon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/site/dropdown_chose_ic.svg b/src/assets/site/dropdown_chose_ic.svg new file mode 100644 index 0000000..e3faa11 --- /dev/null +++ b/src/assets/site/dropdown_chose_ic.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/site/info_filled.svg b/src/assets/site/info_filled.svg new file mode 100644 index 0000000..00b7a39 --- /dev/null +++ b/src/assets/site/info_filled.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/components/GuipDialog.vue b/src/components/GuipDialog.vue index 0fcb2dd..edf10d8 100644 --- a/src/components/GuipDialog.vue +++ b/src/components/GuipDialog.vue @@ -5,11 +5,12 @@ :width="width" :show-close="showCloseButton" :before-close="handleClose" + :class="type == 'center' ?'center' : 'normal'" > - + {{ cancelText }} {{ confirmText }} @@ -22,6 +23,10 @@ export default { name: 'CustomDialog', props: { + type:{ + type:String, + default:'normal' + }, // 控制弹框显示 dialogVisible: { type: Boolean, diff --git a/src/components/GuipSelectFilter.vue b/src/components/GuipSelectFilter.vue new file mode 100644 index 0000000..37a4da6 --- /dev/null +++ b/src/components/GuipSelectFilter.vue @@ -0,0 +1,185 @@ + + + + + \ No newline at end of file diff --git a/src/router/index.js b/src/router/index.js index 7f77300..9948898 100755 --- a/src/router/index.js +++ b/src/router/index.js @@ -7,8 +7,8 @@ import HomeView from '../views/HomeView.vue'; Vue.use(VueRouter) const whiteSlideList = ['/','/ui','/siteList'];//侧边导航白名单 -const whiteHeaderList = ['/','/ui','/register','/settingServicePrice','/siteList'];//头部导航白名单 -const whiteFooterList = ['/','/ui','/settingServicePrice'];//底部白名单 +const whiteHeaderList = ['/','/ui','/register','/configureServicePrices','/siteList'];//头部导航白名单 +const whiteFooterList = ['/','/ui','/configureServicePrices'];//底部白名单 const routes = [ { path: '/', @@ -50,7 +50,7 @@ const routes = [ component: () => import(/* webpackChunkName: "franchise" */ '../views/Franchise.vue') }, { - path: '/settingServicePrice', + path: '/configureServicePrices', name: '配置服务价格', component: () => import(/* webpackChunkName: "franchise" */ '../views/ConfigureServicePrices.vue') }, @@ -59,6 +59,11 @@ const routes = [ name: '站点列表', component: () => import(/* webpackChunkName: "franchise" */ '../views/SiteList.vue') }, + { + path: '/siteBaseSetting', + name: '站点基础设置', + component: () => import(/* webpackChunkName: "franchise" */ '../views/SiteBaseSetting.vue') + }, ] const router = new VueRouter({ diff --git a/src/style/theme/common.scss b/src/style/theme/common.scss index 185abd4..653c0a4 100644 --- a/src/style/theme/common.scss +++ b/src/style/theme/common.scss @@ -497,7 +497,7 @@ body { .el-table th.el-table__cell { background: #F6F7FA; - padding: 18px 0; + padding: 10px 0; } .el-table th.el-table__cell>.cell { @@ -527,7 +527,7 @@ body { // dialog--start .el-dialog { - min-height: 344px; + min-height: 214px; max-height: 550px; border-radius: 4px; background: #FFFFFF; @@ -539,6 +539,7 @@ body { font-size: 20px; font-weight: bold; line-height: 26px; + text-align: left; letter-spacing: 0.08em; color: #1F2026; padding: 32px 32px 12px; @@ -555,17 +556,28 @@ body { justify-content: center; padding: 0 32px 32px !important; - .dialog-footer { + .dialog-footer-center { width: 100%; justify-content: space-between; + button { + width: 247px; + height: 44px; + } } - - button { - width: 247px; - height: 44px; + .dialog-footer-normal { + width: 100%; + justify-content: flex-end !important; + button { + width: 96px; + height: 38px; + } } } - +.center { + .el-dialog .el-dialog__header{ + text-align: center; +} +} // dialog--end // switch --start diff --git a/src/style/theme/index.css b/src/style/theme/index.css index d7096ee..f8cdf3e 100644 --- a/src/style/theme/index.css +++ b/src/style/theme/index.css @@ -10056,7 +10056,7 @@ text-overflow: ellipsis; white-space: normal; word-break: break-all; - line-height: 23px; + line-height: 18px; padding-left: 10px; padding-right: 10px } diff --git a/src/views/SiteList.vue b/src/views/SiteList.vue index 231492a..35515de 100644 --- a/src/views/SiteList.vue +++ b/src/views/SiteList.vue @@ -4,16 +4,38 @@ --> + + + - - - @@ -113,30 +167,80 @@ import Footer from '@/components/Footer.vue'; // import GuipInput from '@/components/GuipInput.vue'; import GuipButton from '@/components/GuipButton.vue'; - +// import GuipSelect from '@/components/GuipSelect.vue'; +import GuipSelectFilter from '@/components/GuipSelectFilter.vue'; +import GuipDialog from '@/components/GuipDialog.vue'; +// import SearchableSelect from '@/components/GuipSelectFilter1.vue'; +// import GuipSelectFilter2 from '@/components/GuipSelectFilter2.vue'; +// import SearchableSelect from '@/components/GuipSelectFilter2.vue' export default { name: 'sitelist', components: { // HelloWorld // GuipInput, + GuipDialog, + GuipSelectFilter, + // SearchableSelect, + // GuipSelectFilter2, + // SearchableSelect, + // GuipSelect, Footer, GuipButton }, data() { return { + searchText: '', + filteredOptions: this.options, + editingIndex: -1, + groupName: '',//分组名称 + addGroupVisiable: false, + selectedValue: '', + fruitOptions: [ + { label: '苹果', value: 'apple' }, + { label: '香蕉', value: 'banana' }, + { label: '橙子', value: 'orange' }, + { label: '葡萄', value: 'grape' }, + { label: '西瓜', value: 'watermelon' }, + { label: '菠萝', value: 'pineapple' } + ], + options: [ + { label: '选项1', value: '1' }, + { label: '选项2', value: '2' }, + { label: '选项3', value: '3' }, + // 更多选项... + ], + selectedValue1: '', + options1: [ + { label: '苹果', value: '1' }, + { label: '香蕉', value: '2' }, + { label: '橙子', value: '22' }, + { label: '葡萄', value: '13' }, + { label: '西瓜', value: '31' }, + { label: '菠萝', value: '32' }, + { label: '菠萝1', value: '14' }, + { label: '菠萝2', value: '15' }, + { label: '菠萝21', value: '156' }, + { label: '菠萝22', value: '24' }, + ], + btnstyleObj_add: { + width: '90px', + height: '30px' + }, tableData: [ { name: '哈哈哈', + link: 'http://www.chachongz.com', registerDate: '2025.02.18', group: '1', - phoneService: '', + phoneService: '撒大事', status: '1',//配置中中 }, { name: '知网学诚教育', + link: 'http://new.checkcopy.com', registerDate: '2025.02.18', group: '2', - phoneService: '', + phoneService: '设计部', status: '0',//运行中 }, ], @@ -175,7 +279,79 @@ export default { ] } }, + mounted() { + const list = ['group', 'status'] + list.forEach(item => { + this.tableData = this.tableData.map(item1 => { + item1[item + '_popover'] = false + return { + ...item1, + } + }) + }) + console.log(this.tableData, '000--'); + + }, methods: { + // 处理搜索输入 + handleSearch(keyword) { + console.log(keyword,'keyword---'); + if (this.filterMethod && typeof this.filterMethod === 'function') { + // 使用自定义筛选方法 + this.filteredOptions = this.filterMethod(keyword, this.options) + } else { + // 默认筛选方法 + if (!keyword) { + this.filteredOptions = this.options + } else { + const lowerKeyword = keyword.toLowerCase() + this.filteredOptions = this.options.filter(item => { + const label = item[this.labelKey] || '' + return label.toString().toLowerCase().includes(lowerKeyword) + }) + } + } + }, + startEditing(index) { + this.editingIndex = index + // 保存原始数据以便取消编辑时恢复 + this.originalData = JSON.parse(JSON.stringify(this.tableData[index])) + }, + + saveEditing() { + this.editingIndex = -1 + this.originalData = null + this.$message.success('保存成功') + }, + + cancelEditing() { + if (this.originalData) { + this.$set(this.tableData, this.editingIndex, this.originalData) + } + this.editingIndex = -1 + this.originalData = null + }, + + handleDepartmentChange(row, index) { + console.log('部门已修改:', index, row.department) + // 可以在这里添加部门变更后的逻辑 + }, + // 确认按钮事件 + handleConfirmAddGroup() { + this.$message.success('点击了确认按钮'); + this.addGroupVisiable = false; + }, + // 取消按钮事件 + handleCancelAddGroup() { + this.$message.warning('点击了取消按钮'); + this.addGroupVisiable = false; + }, + dialogVisibleChange(data) { + console.log(data, 'data098908090'); + }, + handleChange(value) { + console.log('选中值变化:', value) + }, popshow() { var ariaEls = document.querySelectorAll('.el-popover') ariaEls.forEach((item) => { @@ -208,13 +384,57 @@ export default { handleServiceClick(row) { console.log(row); }, + addGroup() { + // 新增分组 + }, + addSite() { + // 新增站点 + }, + // 自定义搜索筛选 + customFilter(keyword, options) { + if (!keyword) return options + return options.filter(item => { + // 自定义筛选逻辑 + return item.label.includes(keyword) || item.value.includes(keyword) + }) + }, + customFilter1(keyword, options) { + if (!keyword) return options + // 自定义筛选逻辑,比如同时匹配 label 和 value + return options.filter(item => { + return ( + item.label.includes(keyword) || + item.value.toString().includes(keyword) + ) + }) + }, + handleFruitChange(value) { + console.log('水果选择变化:', value) + }, + // 气泡弹出框 + handlePriceClick(row, index, type) { + // 关闭其他行的弹框 + this.tableData.forEach((item, i) => { + if (i !== index) { + item[type + '_popover'] = false; + } + }); + // 打开当前行的弹框 + row[type + '_popover'] = true; + row['edit_' + type] = row[type] + // row.edit_price = row.price; // 初始化输入框的值 + }, } } \ No newline at end of file