Browse Source

提交正确版本记录

develop
zq 4 days ago
commit
b876a11353
  1. 1
      .eslintignore
  2. 22
      .eslintrc.js
  3. 30
      .gitignore
  4. 8
      .npmignore
  5. 93
      build/webpack.config.js
  6. 68
      build/webpack.dev.js
  7. 17
      configs/.eslintrc.js
  8. 13
      examples/.gitignore
  9. 8
      examples/.npmignore
  10. 18693
      examples/package-lock.json
  11. 49
      examples/package.json
  12. 809
      examples/src/App.vue
  13. 14
      examples/src/main.js
  14. 19
      examples/vue.config.js
  15. 15055
      package-lock.json
  16. 63
      package.json
  17. 17
      packages/.eslintrc.js
  18. 7
      packages/DevicePreview/index.js
  19. 120
      packages/DevicePreview/src/index.vue
  20. 7
      packages/GroupFormBtns/index.js
  21. 38
      packages/GroupFormBtns/src/index.vue
  22. 7
      packages/GuipButton/index.js
  23. 79
      packages/GuipButton/src/index.vue
  24. 7
      packages/GuipInput/index.js
  25. 150
      packages/GuipInput/src/index.vue
  26. 7
      packages/GuipRadio/index.js
  27. 157
      packages/GuipRadio/src/index.vue
  28. 7
      packages/GuipTextarea/index.js
  29. 90
      packages/GuipTextarea/src/index.vue
  30. 7
      packages/PromptText/index.js
  31. 101
      packages/PromptText/src/index.vue
  32. 1
      packages/assets/addIcon.svg
  33. 1
      packages/assets/addIcon_light.svg
  34. 1
      packages/assets/form_linkActive.svg
  35. 1
      packages/assets/prompt-icon-1.svg
  36. 1
      packages/assets/prompt-icon-2.svg
  37. 1
      packages/assets/prompt-icon-3.svg
  38. 1
      packages/assets/radio_checked.svg
  39. 1
      packages/assets/require.svg
  40. 40
      packages/index.js
  41. 1093
      packages/styles/common.scss
  42. BIN
      packages/styles/fonts/element-icons.ttf
  43. BIN
      packages/styles/fonts/element-icons.woff
  44. 26136
      packages/styles/index.css

1
.eslintignore

@ -0,0 +1 @@
/packages/

22
.eslintrc.js

@ -0,0 +1,22 @@
// .eslintrc.js
module.exports = {
root: true,
env: {
browser: true,
node: true,
es6: true
},
extends: [
'eslint:recommended',
'plugin:vue/essential'
],
parserOptions: {
ecmaVersion: 2018, // 改为 2018(兼容 Vue 2)
sourceType: 'module',
parser: 'babel-eslint'
},
rules: {
'vue/multi-word-component-names': 'off',
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off'
}
}

30
.gitignore

@ -0,0 +1,30 @@
# 根目录 .gitignore
# 依赖目录
node_modules/
examples/node_modules/ # 显式忽略 examples 下的 node_modules
# 构建产物
dist/
packages/dist/
*.log
.DS_Store
# 环境文件
.env
.env.local
# IDE 配置
.idea/
.vscode/
*.swp
# 调试文件
debug.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# 其他
*.tmp
*.bak

8
.npmignore

@ -0,0 +1,8 @@
# 忽略文件
examples/
node_modules/
*.log
*.md
*.yml
webpack.config.js
.gitignore

93
build/webpack.config.js

@ -0,0 +1,93 @@
const path = require('path')
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
const {
VueLoaderPlugin
} = require('vue-loader')
module.exports = {
mode: 'production',
stats: 'verbose',
entry: {
'zhicheng-components': './packages/index.js'
},
output: {
path: path.resolve(__dirname, '../dist'),
filename: '[name].umd.js',
library: 'ZhichengUI',
libraryTarget: 'umd',
umdNamedDefine: true,
globalObject: `(typeof self !== 'undefined' ? self : this)`
},
resolve: {
alias: {
'@': path.resolve(__dirname, './packages') // 确保别名指向正确
}
},
module: {
rules: [
{
test: /\.vue$/,
loader: 'vue-loader',
options: {
compilerOptions: {
preserveWhitespace: false
}
}
},
{
test: /\.css$/,
use: [MiniCssExtractPlugin.loader, 'css-loader'] // 替换style-loader
},
{
test: /\.scss$/,
use: [MiniCssExtractPlugin.loader, 'css-loader', {
loader: 'sass-loader',
options: {
implementation: require('sass') // 显式指定 sass
}
}]
},
{
test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/i,
use: [{
loader: 'url-loader',
options: {
limit: 4096,
name: 'fonts/[name].[hash:8].[ext]',
esModule: false,
publicPath: '../', // 关键:修正 CSS 中的引用路径
}
}]
},
{
test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
use: [{
loader: 'url-loader',
options: {
limit: 4096,
name: 'img/[name].[hash:8].[ext]',
esModule: false,
publicPath: '../'
}
}]
}
]
},
plugins: [
new VueLoaderPlugin(),
new MiniCssExtractPlugin({
filename: 'css/[name].css' // 输出到dist/css/
})
],
optimization: {
splitChunks: false
},
externals: {
vue: {
root: 'Vue',
commonjs: 'vue',
commonjs2: 'vue',
amd: 'vue'
}
}
}

68
build/webpack.dev.js

@ -0,0 +1,68 @@
// build/webpack.dev.js
const path = require('path')
const { merge } = require('webpack-merge')
const baseConfig = require('./webpack.config.js')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const VueLoaderPlugin = require('vue-loader/lib/plugin');
module.exports = merge(baseConfig, {
mode: 'development',
entry: path.resolve(__dirname, '../examples/src/main.js'),
output: {
path: path.resolve(__dirname, '../examples/dist'),
filename: 'bundle.js',
publicPath: '/'
},
resolve: {
alias: {
'vue$': 'vue/dist/vue.esm.js' // 明确指定完整版Vue
}
},
module: {
rules: [
{
test: /\.vue$/,
loader: 'vue-loader',
options: {
compilerOptions: {
preserveWhitespace: false
}
}
},
{
test: /\.js$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader'
}
},
{
test: /\.css$/,
use: ['style-loader', 'css-loader']
},
{
test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
type: 'asset/resource',
generator: {
filename: 'fonts/[name].[hash:8][ext]'
}
},
{test: /\.vue$/, use: 'vue-loader'}
]
},
plugins: [
new HtmlWebpackPlugin({
template: path.resolve(__dirname, '../examples/public/index.html'),
filename: 'index.html'
}),
new VueLoaderPlugin()
],
devServer: {
static: {
directory: path.join(__dirname, '../examples/dist')
},
compress: true,
port: 9000,
hot: true,
open: true
}
})

17
configs/.eslintrc.js

@ -0,0 +1,17 @@
module.exports = {
env: {
browser: true,
es2021: true
},
extends: [
'eslint:recommended',
'plugin:vue/essential'
],
parserOptions: {
ecmaVersion: 12,
sourceType: 'module'
},
rules: {
'vue/multi-word-component-names': 'off'
}
}

13
examples/.gitignore

@ -0,0 +1,13 @@
# examples/.gitignore
# 开发缓存
.vuepress/dist/
.temp/
.cache/
# 测试报告
coverage/
__tests__/__snapshots__/
# 本地调试文件
.local-*

8
examples/.npmignore

@ -0,0 +1,8 @@
# 忽略文件
examples/
node_modules/
*.log
*.md
*.yml
webpack.config.js
.gitignore

18693
examples/package-lock.json

File diff suppressed because it is too large

49
examples/package.json

@ -0,0 +1,49 @@
{
"name": "examples",
"private": true,
"version": "1.0.0",
"description": "Demo project for vue2 component library",
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
},
"dependencies": {
"core-js": "^3.8.3",
"my-components": "file:../",
"vue": "^2.6.14",
"element-ui": "^2.15.13",
"vue-loader": "^17.4.2"
},
"devDependencies": {
"@vue/cli-plugin-babel": "^4.5.19",
"@vue/cli-plugin-eslint": "^4.5.19",
"@vue/cli-service": "^4.5.19",
"sass": "^1.89.2",
"babel-eslint": "^10.1.0",
"sass-loader": "^10.2.0",
"vue-template-compiler": "^2.6.14",
"css-loader": "^5.2.7",
"eslint": "^6.8.0",
"eslint-plugin-vue": "^6.2.2"
},
"browserslist": [
"> 1%",
"last 2 versions",
"not dead"
],
"eslintConfig": {
"root": true,
"env": {
"node": true
},
"extends": [
"plugin:vue/essential",
"eslint:recommended"
],
"parserOptions": {
"parser": "babel-eslint"
},
"rules": {}
}
}

809
examples/src/App.vue

@ -0,0 +1,809 @@
<template>
<div id="app" class="demo-container">
<el-form :model="form" :rules="rules" class="el-row demo-ruleForm" ref="formRef">
<!-- 按钮组件示例 -->
<section class="demo-section">
<h2>页面提示框集合</h2>
<PromptText text='这是一个提示框' :type="1" />
<PromptText text='这是一个提示框' :type="2" />
<PromptText text='这是一个提示框' :type="3" />
<PromptText text="前期准备事项" :type="1" class="beforeNotice">
<template #next_desc>
<p class="flex">
<a href="https://e.360.cn/static/zhihui/login/?rdurl=https%3A%2F%2Fe.360.cn%2F" class="flex"
target="_blank">
<img src="~@assets/form_linkActive.svg" alt="">前往登陆</a>登录360智慧平台
</p>
</template>
<template #desc>
<p class="mt12 flex">
1. <a href="https://e.360.cn/static/zhihui/login/?rdurl=https%3A%2F%2Fe.360.cn%2F" class="flex"
target="_blank">
<img src="~@assets/form_linkActive.svg" alt="">前往登陆</a>登录360智慧平台
</p>
<p class="mt10 flex">
2. <a href="https://dianjing.e.360.cn/ocpc/list" class="flex" target="_blank">
<img src="~@assets/form_linkActive.svg" alt="">前往ocpc设置页</a>点击添加OCPC投放包按钮注意转换类型只能选择订单其他的根据表单提示填写
</p>
</template>
</PromptText>
</section>
<section class="demo-section">
<h2>按钮组件集合</h2>
<div class="ele-item">
<label for="">按钮尺寸</label>
<GuipButton size="superBig">加盟并进入后台</GuipButton>
<GuipButton size="big">准备完毕验证自有域名</GuipButton>
<GuipButton size="page">下一步</GuipButton>
<GuipButton size="primary">保存</GuipButton>
<GuipButton size="table">新增站点</GuipButton>
<GuipButton size="form">前往添加</GuipButton>
</div>
<div class="ele-item">
<label for="">强按钮</label>
<!-- 默认 type= primary normal 样式 -->
<GuipButton>默认</GuipButton>
<GuipButton loading>按钮</GuipButton>
<GuipButton disabled>按钮</GuipButton>
</div>
<div class="ele-item">
<label for="">弱按钮</label>
<GuipButton type="ignore">按钮</GuipButton>
<GuipButton type="ignore" loading>按钮</GuipButton>
<GuipButton type="ignore" disabled>按钮</GuipButton>
</div>
<div class="ele-item">
<label for="">中按钮</label>
<GuipButton type="system">按钮</GuipButton>
<GuipButton type="system" loading>按钮</GuipButton>
<GuipButton type="system" disabled>按钮</GuipButton>
</div>
<div class="ele-item">
<label for="">文字按钮</label>
<GuipButton type="text">强引导</GuipButton>
<GuipButton type="grey">弱引导</GuipButton>
</div>
<div class="ele-item">
<label for="">按钮套餐</label>
<GroupFormBtns />
</div>
</section>
<section class="demo-section">
<h2>输入框集合</h2>
<div class="ele-item">
<label for="">输入框</label>
<GuipInput ref="GuipInput" v-model="form.input1" width="200px" height="30px" placeholder="这是自定义默认提示语" />
<div style="width: 20px;height: 10px;"></div>
<GuipInput ref="GuipInput" v-model="form.input2" :maxlength="100" @change="handleInput" @blur="handleInput"
@input="handleInput" @focus="handleInput" placeholder="这是自定义默认提示语" />
<div style="width: 20px;height: 10px;"></div>
<GuipInput v-model="form.input3" width="400px">
<span slot="prependshow">http:</span>
<!-- <img slot="prefix" src="../assets/radio_checked.svg" alt=""> -->
<!-- 输入框后面小图标 -事件自定义 -->
<i slot="suffix" class="el-icon-close" @click="handleClear"></i>
<!-- <img slot="suffix" src="../assets/radio_nochecked.svg" alt="" @click="handleClear"> -->
<!-- 这个 appendshow 宽度 居中方式 自定义添加类名修改-->
<!-- <GuipButton slot="appendshow" size="mini">默认按钮</GuipButton> -->
<!-- 这个 appendshow 宽度 居中方式 自定义添加类名修改-->
<span slot="appendshow">.checkcopy.com</span>
</GuipInput>
<!-- <el-input placeholder="oieuwroieuwi" style="width:400px;height:60px"></el-input> -->
</div>
<div class="ele-item">
<label for="">文本域固定行数</label>
<GuipTextarea :styleObject="{ width: '450px' }" placeholder="固定行数" :rows="1" />
</div>
<div class="ele-item">
<label for="">文本域自适应高度</label>
<GuipTextarea :styleObject="{ width: '450px' }" placeholder="自适应高度" autosize />
</div>
<div class="ele-item">
<label for="">文本域自定义label描述</label>
<GuipTextarea label="详细介绍" column="column" prop="doctor_detail" width="400px" height="40px"
placeholder="请输入描述内容" desc="啊哈哈哈哈哈哈哈哈" show-word-limit />
</div>
</section>
<section class="demo-section">
<h2>实时预览tab组件</h2>
<DevicePreview>
<template #desktop>
电脑端内容-内容自定义
</template>
<template #mobile>
内容自定义
手机端端内容-- 手机端端内容
</template>
</DevicePreview>
</section>
<section>
<h2>单选框组件集合</h2>
<div class="ele-item">
<label for="">单选框(对象格式)</label>
<GuipRadio v-model="form.language" :options="languageOptions" label="选择语言" prop="language"
@change="radioChange" :rules="rules.language" />
</div>
<div class="ele-item">
<label for="">单选框2数组格式 + 自定义取值</label>
<GuipRadio v-model="form.language" :options="languageOptions1" label="自定义属性" prop="language"
@change="radioChange" :rules="rules.language" label-key="name" :disabledKeys="['1']" value-key="id" />
</div>
<div class="ele-item">
<label for="">单选框</label>
<el-radio v-model="radio1" :label="1">选项一</el-radio>
<el-radio v-model="radio1" :label="2">选项二</el-radio>
</div>
<div class="ele-item">
<label for="">单选框组</label>
<el-radio-group v-model="radio" @input="radioChange">
<el-radio :label="3">备选项</el-radio>
<el-radio :label="6">备选项</el-radio>
<el-radio :label="9">备选项</el-radio>
</el-radio-group>
</div>
</section>
</el-form>
</div>
</template>
<script>
export default {
data() {
return {
content: '测试一下',
domainOptions: [
{
value: '.chachongz.com',
label: '111.chachongz.com',
id: '11',
name: '测试一下自定义名称111'
},
{
value: '.turnitin.org.cn',
label: '222.turnitin.org.cn',
id: '22',
name: '测试一下自定义名称222'
},
{
value: '.jishu.chachongz.com',
label: '333.jishu.chachongz.com',
id: '33',
name: '测试一下自定义名称333'
},
],
tableData3: [{
id: '12987122',
name: '王小虎',
amount1: '234',
amount2: '3.2',
amount3: 10
}, {
id: '12987123',
name: '王小虎',
amount1: '165',
amount2: '4.43',
amount3: 12
}, {
id: '12987124',
name: '王小虎',
amount1: '324',
amount2: '1.9',
amount3: 9
}, {
id: '12987125',
name: '王小虎',
amount1: '621',
amount2: '2.2',
amount3: 17
}, {
id: '12987126',
name: '王小虎',
amount1: '539',
amount2: '4.1',
amount3: 15
}],
tableWidth: 0,
currentPage: 1, //
pageSize: 5, //
total: 0, //
tableLoading: false,
timer: null,
date1: '',
switchValue: true,
switchValue1: 1,
switchValue2: '0',
dialogVisible1: false,
dialogVisible: false,//
showCancelButton: true, //
showCloseButton: true, //
form: {
username: '',
language: '',
domain_set: '',
domainSuffix: '11',
domainSuffix1: '.chachongz.com',
card: '1',
input1: '跨年的烟火,绽放天空',
input2: '',
input3: '',
},
languageOptions1: [
{ label: 'JavaScript', value: 'js', selectedLabel: 'JavaScripthhhhhhhhhh', id: '1', name: '麻辣烫' },
{ label: 'Python', value: 'py', selectedLabel: 'JavaScripthhhhhhhhhh', id: '10', name: '易烊千玺' },
{ label: 'Java', value: 'java', disabled: true, selectedLabel: 'JavaScripthhhhhhhhhh', id: '11', name: '王源' }, //
{ label: 'Go', value: 'go', selectedLabel: 'JavaScripthhhhhhhhhh', id: '12', name: '王俊凯' },
],
languageOptions: {
'20': '查重站',
'31': 'AI站'
},
rules: {
username: [
{ required: true, message: '请输入用户名', trigger: 'blur' }
],
card: [
{ required: true, message: '请选择有效信息', trigger: 'blur' }
],
language: [
{ required: true, message: '请选择语言', trigger: 'blur' },
],
phone: [
{ required: true, message: '请输入手机号', trigger: 'blur' }
],
age: [
{ required: true, message: '请输入年龄', trigger: 'blur' }
]
},
usernameRules: [{ required: true, message: 'Username is required', trigger: 'blur' }],//rules
msg: "测试",
title: "相关附件",
edit: false,
action: true,
header: false,
width: 1920,
height: 1080,
dataList: [
{ name: "张三", age: 19, id: 1 },
{ name: "李四", age: 20, id: 2 },
],
formList: [],
//
fromItem: {
id: "Shanghai",
id1: "选项4",
name: "用户名",
radioId: "2",
checkboxId: ["上海", "北京"],
textareaIner: "textarea",
dateTime: "2023-09-12 00:00:00",
uploadList: [
{
name: "小梨猫.jpg",
size: 160517,
uid: 1695291434025,
url: "https://ts1.cn.mm.bing.net/th?id=OIP-C.Zte3ljd4g6kqrWWyg-8fhAHaEo&w=316&h=197&c=8&rs=1&qlt=90&o=6&dpr=1.5&pid=3.1&rm=2",
},
],
},
//
tableData2: [{
date: '2016-05-03',
name: '王小虎',
address: '上海市普陀区金沙江路 1518 弄',
price: '20',
age: 20,
//
edit_name: '王小虎', edit_address: '上海市普陀区金沙江路 1518 弄'
}, {
date: '2016-05-02',
name: '王小虎11',
address: '上海市普陀区金沙江路 151811 弄',
price: '10',
age: 30,
edit_name: '王小虎11', edit_address: '上海市普陀区金沙江路 151811 弄'
}, {
date: '2016-05-04',
name: '王小虎',
address: '上海市普陀区金沙江路 1518 弄',
price: '200',
}, {
date: '2016-05-01',
name: '王小虎',
address: '上海市普陀区金沙江路 1518 弄'
}, {
date: '2016-05-08',
name: '王小虎',
address: '上海市普陀区金沙江路 1518 弄'
}, {
date: '2016-05-06',
name: '王小虎',
address: '上海市普陀区金沙江路 1518 弄'
}, {
date: '2016-05-07',
name: '王小虎',
address: '上海市普陀区金沙江路 1518 弄'
}],
tableData4: [{
date: '2016-05-03',
name: '王小虎',
address: '上海市普陀区金沙江路 1518 弄',
price: '20',
age: 20,
//
edit_name: '王小虎', edit_address: '上海市普陀区金沙江路 1518 弄'
}, {
date: '2016-05-02',
name: '王小虎11',
address: '上海市普陀区金沙江路 151811 弄',
price: '10',
age: 30,
edit_name: '王小虎11', edit_address: '上海市普陀区金沙江路 151811 弄'
}, {
date: '2016-05-04',
name: '王小虎',
address: '上海市普陀区金沙江路 1518 弄',
price: '200',
}, {
date: '2016-05-01',
name: '王小虎',
address: '上海市普陀区金沙江路 1518 弄'
}, {
date: '2016-05-08',
name: '王小虎',
address: '上海市普陀区金沙江路 1518 弄'
}, {
date: '2016-05-06',
name: '王小虎',
address: '上海市普陀区金沙江路 1518 弄'
}, {
date: '2016-05-07',
name: '王小虎',
address: '上海市普陀区金沙江路 1518 弄'
}],
//
columns: [
{ prop: 'name', label: '姓名(带气泡)', popover: true }, //
{ prop: 'age', label: '年龄', popover: true }, //
{ prop: 'address', label: '地址(带气泡)', popover: true }, //
],
optionss: [
{
value: "选项1",
label: "黄金糕",
},
{
value: "选项2",
label: "双皮奶",
},
{
value: "选项3",
label: "蚵仔煎",
},
{
value: "选项4",
label: "龙须面",
},
{
value: "选项5",
label: "北京烤鸭",
},
],
cities: [
{
value: "Beijing",
label: "北京",
},
{
value: "Shanghai",
label: "上海",
},
{
value: "Nanjing",
label: "南京",
},
{
value: "Chengdu",
label: "成都",
},
{
value: "Shenzhen",
label: "深圳",
},
{
value: "Guangzhou",
label: "广州",
}
],
tableData: [],
input: 'hahhahah',
defaultValue: 'asdasda',
radio: 3,
radio1: 5,
btnstyleObj: {
width: '388px',
height: '46px',
borderRadius: '4px',
background: '#006AFF',
},
btnstyleObj1: {
width: '247px',
height: '46px',
borderRadius: '4px',
},
styleObject: {
minWidth: '200px',
maxWidth: '400px',
// height: '40px'
},
styleObject1: {
width: '600px',
height: '50px'
},
plain: false,
options: [{
value: '选项1',
label1: '黄金hhhhhh',
id1: '1',
id2: '啊11哈哈',
label: '黄金糕'
}, {
value: '选项2',
id1: '12',
id2: '啊22哈哈',
label1: '双皮奶hhhhhhhhh',
label: '双皮奶'
}, {
value: '选项3',
id1: '13',
id2: '啊33哈哈',
label1: '蚵仔煎hhhhhhhhh',
label: '蚵仔煎'
}, {
value: '选项4',
id1: '14',
id2: '啊444哈哈',
label1: '双皮奶hhhhhhhhh',
label: '龙须面'
}, {
value: '选项5',
id1: '155',
id2: '啊55哈哈',
label1: '双皮奶hhhhhhhhh',
label: '北京烤鸭'
}],
}
},
created() {
console.log('当前组件注册情况:', this.$options.components)
},
computed: {
currentDomainItem() {
return this.findItemById('id', 'domainSuffix');
}
},
methods: {
// copy
handleClickCopy() {
this.$copy(this.form.input1, {
successMsg: '内容已复制到剪贴板',
errorMsg: '复制失败,请按Ctrl+C手动复制',
vm: this
});
},
// radio label
formatLabel(option) {
return `${option.name} (ID: ${option.id})`;
},
findItemById(valueKey, key) {
//
return this.domainOptions.find(item => item[valueKey] === this.form[key]);
},
toggleDrop1(e) {
this.$refs.dropDomain1.toggleDropdown(e)
},
toggleDrop(e) {
this.$refs.dropDomain.toggleDropdown(e)
},
changeInputtest(e) {
console.log(e, '---000changeInputtest');
},
changeSelectIp(item) {
//
// this.selectedItem1 = { ...item };
console.log(item, this.form.domainSuffix, this.form.domainSuffix1, '选中的项-值-');
},
arraySpanMethod({ row, column, rowIndex, columnIndex }) {
console.log(row, column);
if (rowIndex % 2 === 0) {
if (columnIndex === 0) {
return [1, 2];
} else if (columnIndex === 1) {
return [0, 0];
}
}
},
objectSpanMethod({ row, column, rowIndex, columnIndex }) {
console.log(row, column);
if (columnIndex === 0) {
if (rowIndex % 2 === 0) {
return {
rowspan: 2,
colspan: 1
};
} else {
return {
rowspan: 0,
colspan: 0
};
}
}
},
openMessage(type) {
console.log(type);
//
switch (type) {
case 'success':
this.$Message.success('成功,文案自定义')
break;
case 'error':
this.$Message.error('失败,文案自定义')
break;
case 'info':
this.$Message.info('提示,文案自定义')
break;
}
//
// this.$Message({
// type: 'success',
// title: '',
// message: '',
// duration: 5000,
// showClose: true,
// center: true
// })
},
showTooltip() {
this.$refs.tooltip.show()
},
hideTooltip() {
this.$refs.tooltip.hide()
},
handleSizeChange(val) {
this.pageSize = val
this.getStagePurchase()
},
handleCurrentChange(val) {
this.currentPage = val
this.getStagePurchase()
},
getStagePurchase() {
this.tableLoading = true
const that = this
that.tableData = []
this.$http('POST', '/supernew/ajax_get_stage_purchase', {
type: 0,
cur_page: 1,
page_size: 5,
}, {
headers: {
'AUTH': '3c901fa4a19a7ad9d01238890863d499'
}
}).then(response => {
this.tableLoading = false
this.$nextTick(() => {
that.tableData = response.data.list
// console.log(that.tableData,'---that.tableData');
// that.type2name = response.data.type2name
that.total = response.data.total
})
}).catch(error => {
console.error(error, 'error')
})
},
btnClick() {
},
openLoading() {
this.$store.dispatch('showLoading')
setTimeout(() => {
this.$store.dispatch('hideLoading')
}, 2000)
},
handleFilter(column) {
//
console.log('筛选列:', column);
},
// key
random() {
var randomNumber = Math.random();
return randomNumber
},
onSwitchChange(value) {
console.log('Switch 状态变化:', this.switchValue, value);
},
// ---start
openDialog() {
this.dialogVisible = true;
},
openDialog1() {
this.dialogVisible1 = true;
},
//
handleConfirm() {
this.$message.success('点击了确认按钮');
this.dialogVisible = false;
},
//
handleCancel() {
this.$message.warning('点击了取消按钮');
this.dialogVisible = false;
this.dialogVisible1 = false;
},
//
handleClose() {
this.$message.info('弹框已关闭');
this.dialogVisible = false;
},
dialogVisibleChange(data) {
console.log(data, 'data098908090');
},
// ---end
//
handlePriceClick(row) {
this.currentRow = row;
this.editedPrice = row.price;
this.dialogVisible = true;
},
// -----
//
onConfirm(row, prop) {
console.log('确认修改:', row, prop);
this.$message.success('修改成功');
this.$set(this.tableData4, row)
console.log(this.tableData4, 'this.tableData=====');
},
//
onCancel(row, prop) {
console.log('取消修改:', row, prop);
this.$message.info('已取消');
this.$set(this.tableData, row)
},
// -----
//
radioChange(data) {
console.log(data, 'radio--data');
},
handleClick(row) {
console.log(row);
},
submitForm() {
this.$refs.formRef.validate((valid) => {
console.log(this.form, '======formxinxi');
if (valid) {
alert('提交成功!');
} else {
return false;
}
});
},
//
resetForm() {
this.$refs.form.resetFields();
},
triggerError() {
this.$refs.formRef.validateField('username', (error) => {
if (error) {
console.log('错误信息:', error);
} else {
console.log('无错误');
}
});
},
getFormdata() {
console.log(this.$refs.GuipInput.value);
},
handleInput(value) {
console.log(value, 'value===输入框输入得知');
},
handleClear(value) {
this.form.input3 = '这是我清除后给的文案'
// this.handleInput('')
console.log(value, 'value===qinghcu');
},
getList() {
const dataList = rules();
dataList.forEach((item) => {
if (item.field === "id") {
item.options = this.cities;
}
if (item.field === "id1") {
item.options = this.optionss;
}
});
this.formList = dataList;
},
save() {
this.$refs.VabForm.submitForm("ruleForm");
},
//
cancellation() {
this.$refs.VabForm.resetForm("ruleForm");
},
//
handleSelectionChange(data) {
// data
//
console.log(data, '表格行信息');
},
//
toggleAllSelection() {
// console.log(this.$refs.multipleTable,'this.$refs.multipleTable');
this.$refs.multipleTable.$refs.guiptable.toggleAllSelection();
},
},
beforeDestroy() {
if (this.timer) {
clearTimeout(this.timer)
// loading
this.$store.dispatch('hideContentLoading')
}
}
}
</script>
<style scoped>
.demo-container {
padding: 20px;
max-width: 90%;
margin: 0 auto;
}
.ele-item {
display: flex;
align-items: center;
justify-content: flex-start;
margin: 20px 0 30px;
label {
font-size: 16px;
font-weight: bold;
width: 100px;
margin-right: 10px;
text-align: left;
}
}
.demo-section {
margin: 30px 0;
padding: 20px;
border: 1px solid #eee;
border-radius: 4px;
}
h2 {
color: #333;
margin-bottom: 15px;
padding-bottom: 10px;
border-bottom: 1px solid #f0f0f0;
}
</style>

14
examples/src/main.js

@ -0,0 +1,14 @@
import Vue from 'vue/dist/vue.esm.js' // 必须用完整版
import App from './App.vue'
import ElementUI from 'element-ui';
import MyComponents from '../../packages' // 本地引用组件库
// import 'element-ui/lib/theme-chalk/index.css' // 如果依赖Element
// import './style/theme/index.css'
// import './style/theme/common.scss'
Vue.use(MyComponents)
Vue.use(ElementUI);
Vue.config.productionTip = false
new Vue({
render: h => h(App)
}).$mount('#app')

19
examples/vue.config.js

@ -0,0 +1,19 @@
const path = require('path')
module.exports = {
chainWebpack: config => {
config.devServer.watchOptions({
ignored: /node_modules/,
poll: 1000 // 检查文件变化的频率
})
},
lintOnSave: false,
configureWebpack: {
resolve: {
alias: {
// 别名
'@assets': path.resolve(__dirname, '../packages/assets')
}
}
}
}

15055
package-lock.json

File diff suppressed because it is too large

63
package.json

@ -0,0 +1,63 @@
{
"name": "@zhicheng1012/zhicheng-components",
"version": "1.0.9",
"description": "A Vue 2 component library",
"main": "dist/zhicheng-components.umd.js",
"publishConfig": {
"access": "public"
},
"sideEffects": [
"**/*.css",
"**/*.scss"
],
"module": "dist/zhicheng-components.esm.js",
"files": [
"dist",
"packages"
],
"scripts": {
"build": "webpack --config build/webpack.config.js",
"serve": "cd examples && npm run serve",
"lint": "eslint --ext .js,.vue packages",
"prepublishOnly": "npm run build",
"release": "npm version patch && npm publish"
},
"devDependencies": {
"babel-eslint": "~10.1.0",
"css-loader": "~5.2.7",
"eslint": "~6.8.0",
"eslint-plugin-vue": "~6.2.2",
"file-loader": "^6.2.0",
"mini-css-extract-plugin": "^1.6.2",
"sass": "^1.32.13",
"sass-loader": "^8.0.2",
"style-loader": "~2.0.0",
"url-loader": "^4.1.1",
"vue": "^2.6.14",
"vue-loader": "^15.9.8",
"vue-svg-loader": "^0.16.0",
"vue-template-compiler": "^2.6.14",
"webpack": "~4.46.0",
"webpack-cli": "~4.10.0"
},
"peerDependencies": {
"element-ui": "^2.15.14",
"vue": "^2.6.14"
},
"browserslist": [
"> 1%",
"last 2 versions",
"not dead",
"not ie 11"
],
"engines": {
"node": ">=12.0.0 <=16.x",
"npm": ">=6.0.0"
},
"keywords": [
"vue2",
"component-library",
"ui-components"
],
"license": "MIT"
}

17
packages/.eslintrc.js

@ -0,0 +1,17 @@
module.exports = {
env: {
browser: true,
es2021: true
},
extends: [
'eslint:recommended',
'plugin:vue/essential'
],
parserOptions: {
ecmaVersion: 12,
sourceType: 'module'
},
rules: {
'vue/multi-word-component-names': 'off'
}
}

7
packages/DevicePreview/index.js

@ -0,0 +1,7 @@
import DevicePreview from './src/index.vue'
DevicePreview.install = function(Vue) {
Vue.component(DevicePreview.name || 'DevicePreview', DevicePreview)
}
export default DevicePreview

120
packages/DevicePreview/src/index.vue

@ -0,0 +1,120 @@
<template>
<div class="preview-container">
<div class="preview_top flex-between">
<b class="preview-title">实时预览</b>
<div class="toggle-container">
<div class="toggle-button" v-if="showPc" :class="{ active: activeView === 'desktop' }"
@click="switchView('desktop')">
电脑端
</div>
<div class="toggle-button" v-if="showMobile" :class="{ active: activeView === 'mobile' }"
@click="switchView('mobile')">
手机端
</div>
</div>
</div>
<div class="content-container">
<!-- 电脑端内容 -->
<div v-show="activeView === 'desktop'" class="desktop-view">
<slot name="desktop"></slot>
</div>
<!-- 手机端内容 -->
<div v-show="activeView === 'mobile'" class="mobile-view">
<slot name="mobile"></slot>
</div>
</div>
</div>
</template>
<script>
export default {
name: 'DevicePreview',
props:{
showMobile:{
type:Boolean,
default:true
},
showPc:{
type:Boolean,
default:true
},
},
data() {
return {
activeView: 'desktop' //
}
},
methods: {
switchView(view) {
this.activeView = view;
}
}
}
</script>
<style scoped>
.preview-container {
max-width: 800px;
min-width: 300px;
margin: 0 auto;
padding: 24px;
border-radius: 4px;
background: #FAFAFA;
}
.preview_top{
margin-bottom: 20px;
}
.preview-title {
text-align: center;
color: #1E2226;
}
.toggle-container {
display: flex;
height: 26px;
justify-content: center;
align-items: center;
padding: 3px 6px;
border-radius: 4px;
background: #F2F3F5;
}
.toggle-button {
padding: 1px 12px;
border-radius: 2px;
box-sizing: border-box;
cursor: pointer;
transition: all 0.3s ease;
}
.toggle-button.active {
color: #006AFF;
background: #FFFFFF;
}
.toggle-button.active:after {
/* content: '';
position: absolute;
bottom: -11px;
left: 0;
width: 100%;
height: 2px;
background-color: #1890ff; */
}
.content-container {
/* min-height: 300px;
padding: 20px;
border: 2px solid #ffd700;
border-radius: 4px;
background-color: #fff; */
}
.desktop-view,
.mobile-view {
width: 100%;
}
</style>

7
packages/GroupFormBtns/index.js

@ -0,0 +1,7 @@
import GroupFormBtns from './src/index.vue'
GroupFormBtns.install = function(Vue) {
Vue.component(GroupFormBtns.name || 'GroupFormBtns', GroupFormBtns)
}
export default GroupFormBtns

38
packages/GroupFormBtns/src/index.vue

@ -0,0 +1,38 @@
<template>
<div class="btns-wrap flex">
<GuipButton type="ignore" @click="cancelClick">取消</GuipButton>
<GuipButton type="primary" @click="confirmClick">保存</GuipButton>
</div>
</template>
<script>
import GuipButton from '../../GuipButton/src/index.vue';
export default {
name: 'GroupFormBtns',
props: [''],
components: {
GuipButton
},
data(){
return{
}
},
methods:{
cancelClick(){
this.$emit('cancel')
},
confirmClick(){
this.$emit('confirm')
}
}
}
</script>
<style scoped lang="scss">
.btns-wrap{
margin-top: 24px;
justify-content: flex-end;
}
</style>

7
packages/GuipButton/index.js

@ -0,0 +1,7 @@
import GuipButton from './src/index.vue'
GuipButton.install = function(Vue) {
Vue.component(GuipButton.name || 'GuipButton', GuipButton)
}
export default GuipButton

79
packages/GuipButton/src/index.vue

@ -0,0 +1,79 @@
<template>
<el-button
:type="type"
v-bind="$attrs"
:plain="plain"
:loading="loading"
:size="size"
:disabled="disabled"
@click="$emit('click')"
:style="{...btnstyle}"
>
<slot></slot>
</el-button>
</template>
<script>
export default {
name: 'GuipButton',
props:{
type:{
type:String,
default:'primary'
},
size:{
type:String,
default:'normal'
},
// false
plain:{
type:Boolean,
default:false
},
loading:{
type:Boolean,
default:false
},
disabled:{
type:Boolean,
default:false
},
btnstyle:Object
},
data() {
return {
radio: ''
}
},
render(h) {
return h('el-button', {
attrs: this.$attrs,
on: {
click: e => this.$emit('click', e)
}
}, this.$slots.default)
},
mounted(){
}
}
</script>
<style scoped lang="scss">
button span{
display: flex;
align-items: center;
}
.rotating-svg {
animation: rotate 2s linear infinite;
}
@keyframes rotate {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
</style>

7
packages/GuipInput/index.js

@ -0,0 +1,7 @@
import GuipInput from './src/index.vue'
GuipInput.install = function(Vue) {
Vue.component(GuipInput.name || 'GuipInput', GuipInput)
}
export default GuipInput

150
packages/GuipInput/src/index.vue

@ -0,0 +1,150 @@
<template>
<el-form-item :style="{ ...styleObject }" :required="required"
:class="[{ 'column': column }, { 'w510': addClass == 'w510' }, { 'w388': addClass == 'w388' }, 'form-item']" :label="label"
:prop="prop" :rules="rules">
<p v-if="desc" class="desc_right">{{ desc }}</p>
<el-input :type="type" v-bind="$attrs" :placeholder="placeholder1" :disabled="disabled" :maxlength="maxlength1"
:style="{ width: width, height: height }" :value="inputValue" :minLength="minLength1" :show-word-limit="showWordLimit"
@input="$emit('input', $event)" @keydown="handleKeydown" @change="$emit('change', $event)"
@blur="$emit('blur', inputValue)" @focus="$emit('focus', inputValue)" >
<!-- 自定义前面小图标 -->
<template v-slot:prepend>
<slot name="prependshow"></slot>
</template>
<template v-slot:prefix>
<slot name="prefix"></slot>
</template>
<!-- 清除小图标 -->
<template v-slot:suffix>
<slot name="suffix"></slot>
</template>
<template v-slot:append>
<slot name="appendshow"></slot>
</template>
<!-- :error="errorMessage" show-message -->
<!-- <i slot="suffix" v-if="empty" class="el-icon-close" @click="handleClear">h</i> -->
<!-- <el-button slot="append" v-if="hasBtn" type="primary" @click="$emit('enter',value)">搜索</el-button> -->
</el-input>
<!-- 单位 -->
<span class="unit" v-if="unit">{{ unit }}</span>
</el-form-item>
</template>
<script>
export default {
name: 'GuipInput',
props: ['value', 'styleObject', 'disabled', 'defaultValue', 'placeholder','required',
'maxlength', 'minLength', 'clear', 'width', 'height', 'showWordLimit',
'label', 'type', 'prop', 'rules', 'column', 'addClass', 'desc', 'unit'],
data() {
return {
inputValue: this.value || this.defaultValue,
maxlength1: '',
minLength1: 0,
style: {
width: '510px',
height: '38px'
},
placeholder1: ''
}
},
watch: { // value prop 便 inputValue
// defaultValue(newVal) {
// console.log(newVal,'newVal');
// this.inputValue = newVal;
// },
value(newVal) {
this.inputValue = newVal;
},
defaultValue(newVal) {
// valuedefaultValue
if (!this.value && newVal !== this.inputValue) {
this.inputValue = newVal;
}
}
},
created() {
//
// if (this.defaultValue != null) {
// this.inputValue = this.defaultValue;
// }
//
if (this.placeholder) {
this.placeholder1 = this.placeholder;
}
//
if (this.maxlength) {
this.maxlength1 = this.maxlength;
}
//
if (this.minLength) {
this.minLength1 = this.minLength;
}
},
mounted() {
this.$nextTick(() => {
let els = document.querySelectorAll('.el-input');
els.forEach(item => {
item.onmouseover = function () {
item.classList.add("hoverclass")
}
item.onmouseout = function () {
item.classList.remove("hoverclass")
}
// item.addEventListener('mouseover',function(){
// console.log('');
// item.classList.add("hoverclass")
// })
// item.addEventListener('mouseoout',function(){
// console.log('');
// item.classList.remove("hoverclass")
// })
// item.addEventListener('mouseoenter',function(){
// console.log('---');
// item.classList.add("hoverclass")
// })
// item.addEventListener('mouseoleave',function(){
// console.log('');
// item.classList.remove("hoverclass")
// })
})
// console.log(el,'====9999');
// if(els&& this.styleObject){
// for(var key in this.styleObject){
// els.style[key] = this.styleObject[key]
// }
// }
})
},
methods: {
// input
// changeInput(event){
// this.$emit('input', event);
// }
// handleClear(){
// console.log('---');
// this.$emit('clear', '')
// }
handleKeydown(e) {
console.log(e);
// if (e.key === '1') {
e.preventDefault(); //
// }
},
}
}
</script>
<style lang="scss" scoped>
.unit {
position: absolute;
right: 12px;
/* 根据需要调整位置 */
top: 50%;
transform: translateY(-50%);
pointer-events: none;
/* 防止单位文本影响输入框的点击事件 */
}
</style>

7
packages/GuipRadio/index.js

@ -0,0 +1,7 @@
import GuipRadio from './src/index.vue'
GuipRadio.install = function(Vue) {
Vue.component(GuipRadio.name || 'GuipRadio', GuipRadio)
}
export default GuipRadio

157
packages/GuipRadio/src/index.vue

@ -0,0 +1,157 @@
<template>
<el-form-item :class="[{ 'column': column }, 'form-item']" :label="label" :prop="prop" :rules="rules"
:required="required">
<el-radio-group v-model="selectedValue" v-bind="$attrs" @change="handleChange">
<el-radio v-for="(optionValue, optionKey) in normalizedOptions" :key="optionKey"
:label="getValue(optionValue)" :disabled="isDisabled(optionValue[valueKey])">
{{ getLabel(optionValue) }}
</el-radio>
</el-radio-group>
</el-form-item>
</template>
<script>
export default {
name: 'GuipRadio',
props: {
//
column: {
type: String,
default: ''
},
required: {
type: Boolean,
default: false
},
// :
// 1. : [{ label: '', value: '', disabled: false }]
// 2. : { key1: 'value1', key2: 'value2' }
// 3.null
// 4.
options: {
// type: [Array, Object],
default: () => null,
validator: (value) => {
// null
return value == null ||
value === '' ||
Array.isArray(value) ||
(typeof value === 'object' && value !== null)
},
required: true,
},
// 使 v-model
value: {
type: [String, Number, Boolean],
default: '',
},
// label
label: {
type: String,
default: '',
},
// prop
prop: {
type: String,
default: '',
},
//
rules: {
type: Array,
default: () => [],
},
labelKey: {
type: String,
default: 'label'
},
// value
valueKey: {
type: String,
default: 'value'
},
// label
formatter: {
type: Function,
default: null
},
// key
disabledKeys: {
type: Array,
default: () => []
}
},
computed: {
//
normalizedOptions() {
// nullundefined
if (this.options == null || !this.options) {
return [];
}
//
if (Array.isArray(this.options)) {
return this.options.length ? this.options : [];
}
//
if (typeof this.options === 'object') {
const keys = Object.keys(this.options);
return keys.length ? keys.map(key => ({
key,
value: this.options[key]
})) : [];
}
//
return [];
}
},
data() {
return {
selectedValue: this.value, //
};
},
watch: {
// value selectedValue
value(newVal) {
this.selectedValue = newVal;
},
},
methods: {
//
handleChange(value) {
this.$emit('input', value); // v-model
this.$emit('change', value); // change
},
getLabel(option) {
if (this.formatter) return this.formatter(option);
//
if (typeof option === 'object' && 'key' in option && 'value' in option) {
return option.value;
}
return option[this.labelKey] || option;
},
getValue(option) {
//
if (typeof option === 'object' && 'key' in option && 'value' in option) {
return option.key;
}
return option[this.valueKey] || option;
},
//
isDisabled(key) {
return this.disabledKeys.includes(key);
}
},
};
</script>
<style scoped>
/* 自定义样式 */
.el-radio-group {
margin: 10px 0;
}
</style>

7
packages/GuipTextarea/index.js

@ -0,0 +1,7 @@
import GuipTextarea from './src/index.vue'
GuipTextarea.install = function(Vue) {
Vue.component(GuipTextarea.name || 'GuipTextarea', GuipTextarea)
}
export default GuipTextarea

90
packages/GuipTextarea/src/index.vue

@ -0,0 +1,90 @@
<template>
<el-form-item :label="label" :prop="prop" :rules="rules" :class="[{ 'column': column }]" :required="required">
<p v-if="desc" class="desc_right">{{ desc }}</p>
<el-input
type="textarea"
v-bind="$attrs"
v-model="innerValue"
:style="{ width: width, height: height }"
:rows="rows"
@input="handleInput"
@change="handleChange"
></el-input>
</el-form-item>
</template>
<script>
export default {
name: 'GuipTextarea',
inheritAttrs: false,
props: {
// v-model
value: {
type: [String, Number],
default: ''
},
// '100px' '100%'
width: {
type: String,
default: '100%'
},
desc: {
type: String,
default: ''
},
// '100px' '100%'
height: {
type: String,
default: 'auto'
},
//
rows: {
type: Number,
default: 4
},
//
label: {
type: String,
default: ''
},
column: {
type: String,
default: ''
},
// prop
prop: {
type: String,
default: ''
},
//
rules: {
type: [Object, Array],
default: () => []
},
required:{
type: Boolean,
default: false
}
},
data() {
return {
innerValue: this.value
}
},
watch: {
value(newVal) {
if (newVal !== this.innerValue) {
this.innerValue = newVal
}
}
},
methods: {
handleInput(value) {
this.$emit('input', value)
},
handleChange(value) {
this.$emit('change', value)
}
}
}
</script>

7
packages/PromptText/index.js

@ -0,0 +1,7 @@
import PromptText from './src/index.vue'
PromptText.install = function(Vue) {
Vue.component(PromptText.name || 'PromptText', PromptText)
}
export default PromptText

101
packages/PromptText/src/index.vue

@ -0,0 +1,101 @@
<template>
<div class="prompt-text" :class="typeClass">
<div class="flex-text">
<div class="flex">
<img class="prompt-icon" :src="typeIcon" alt="">
<span class="prompt-desc">{{ text }}</span>
</div>
<div class="flex">
<slot name="next_desc" />
</div>
</div>
<div class="prompt-extra">
<slot name="desc" />
</div>
</div>
</template>
<script>
export default {
name: 'PromptText',
props: {
text: {
type: String,
required: true
},
type: {
type: [Number, String],
default: 2
},
},
components: {
},
data() {
return {}
},
computed: {
typeClass() {
switch (parseInt(this.type)) {
case 1: return 'info';
case 2: return 'notice';
case 3: return 'warning';
default: return 'notice';
}
},
typeIcon() {
switch (parseInt(this.type)) {
case 1: return require('../../assets/prompt-icon-1.svg');
case 2: return require('../../assets/prompt-icon-2.svg');
case 3: return require('../../assets/prompt-icon-3.svg');
default: return require('../../assets/prompt-icon-2.svg');
}
}
},
methods: {
}
}
</script>
<style scoped lang="scss">
.prompt-text {
padding: 8px 13px;
border-radius: 4px;
}
.flex-text {
display: flex;
align-items: center;
align-self: stretch;
justify-content: space-between;
z-index: 1;
}
.info {
background: #F2F7FF;
border: 1px solid #BFDAFF;
}
.notice {
background: #FEFCE8;
border: 1px solid rgba(255, 140, 0, 0.3);
}
.warning {
background: #FFF1F0;
border: 1px solid #FFA39E;
}
.prompt-icon {
width: 16px;
height: 16px;
;
margin-right: 8px;
}
.prompt-desc {
color: #1E2226;
letter-spacing: 0.08em;
}
.prompt-extra {}
</style>

1
packages/assets/addIcon.svg

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 12 KiB

1
packages/assets/addIcon_light.svg

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 12 KiB

1
packages/assets/form_linkActive.svg

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 8.1 KiB

1
packages/assets/prompt-icon-1.svg

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="16" height="16" viewBox="0 0 16 16"><defs><clipPath id="master_svg0_217_60685"><rect x="0" y="0" width="16" height="16" rx="0"/></clipPath></defs><g clip-path="url(#master_svg0_217_60685)"><g><path d="M8,1C9.97933,1.052,11.6278,1.7368329999999998,12.9455,3.0545C14.2632,4.372170000000001,14.948,6.02067,15,8C14.948,9.97933,14.2632,11.6278,12.9455,12.9455C11.6278,14.2632,9.97933,14.948,8,15C6.02067,14.948,4.372170000000001,14.2632,3.0545,12.9455C1.7368329999999998,11.6278,1.052,9.97933,1,8C1.052,6.02067,1.7368329999999998,4.372170000000001,3.0545,3.0545C4.372170000000001,1.7368329999999998,6.02067,1.052,8,1C8,1,8,1,8,1C8,1,8,1,8,1ZM9.047,5.297C9.318,5.297,9.542,5.21633,9.719,5.055C9.896,4.89367,9.9845,4.6775,9.9845,4.406499999999999C9.9845,4.1355,9.896,3.91933,9.719,3.758C9.542,3.59667,9.32067,3.516,9.055,3.516C8.78933,3.516,8.568,3.59667,8.391,3.758C8.214,3.91933,8.125499999999999,4.1355,8.125499999999999,4.406499999999999C8.125499999999999,4.6775,8.214,4.89367,8.391,5.055C8.568,5.21633,8.78683,5.297,9.0475,5.297C9.0475,5.297,9.047,5.297,9.047,5.297C9.047,5.297,9.047,5.297,9.047,5.297ZM9.2345,10.922C9.2345,10.85933,9.23967,10.776,9.25,10.672C9.26033,10.568,9.26033,10.469,9.25,10.375C9.25,10.375,8.422,11.328,8.422,11.328C8.33867,11.4217,8.25267,11.4947,8.164,11.547C8.075330000000001,11.5993,7.99983,11.615,7.9375,11.594C7.84383,11.5523,7.80217,11.4793,7.8125,11.375C7.8125,11.375,9.1875,7.047,9.1875,7.047C9.2395,6.75533,9.19267,6.50533,9.047,6.297C8.90133,6.08867,8.667,5.96367,8.344000000000001,5.922C7.97933,5.93233,7.58083,6.086,7.1485,6.383C6.71617,6.68,6.3385,7.05767,6.0155,7.516C6.0155,7.516,6.0155,7.7505,6.0155,7.7505C6.00517,7.85483,6.00517,7.95383,6.0155,8.0475C6.0155,8.0475,6.8435,7.0945,6.8435,7.0945C6.92683,7.00083,7.01283,6.92783,7.1015,6.8755C7.19017,6.82317,7.2605,6.8075,7.3125,6.8285C7.41683,6.8805,7.45333,6.96383,7.422,7.0785C7.422,7.0785,6.0625,11.391,6.0625,11.391C5.9895,11.6513,6.026,11.8832,6.172,12.0865C6.318,12.2898,6.57317,12.4278,6.9375,12.5005C7.4585,12.4902,7.896,12.3392,8.25,12.0475C8.604,11.7558,8.93217,11.3808,9.2345,10.9225C9.2345,10.9225,9.2345,10.922,9.2345,10.922C9.2345,10.922,9.2345,10.922,9.2345,10.922Z" fill="#006AFF" fill-opacity="1"/></g></g></svg>

After

Width:  |  Height:  |  Size: 2.3 KiB

1
packages/assets/prompt-icon-2.svg

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="16" height="16" viewBox="0 0 16 16"><defs><clipPath id="master_svg0_354_94660/23_30613"><rect x="0" y="0" width="16" height="16" rx="0"/></clipPath></defs><g clip-path="url(#master_svg0_354_94660/23_30613)"><g><path d="M8,1C9.97933,1.052,11.6278,1.7368329999999998,12.9455,3.0545C14.2632,4.372170000000001,14.948,6.02067,15,8C14.948,9.97933,14.2632,11.6278,12.9455,12.9455C11.6278,14.2632,9.97933,14.948,8,15C6.02067,14.948,4.372170000000001,14.2632,3.0545,12.9455C1.7368329999999998,11.6278,1.052,9.97933,1,8C1.052,6.02067,1.7368329999999998,4.372170000000001,3.0545,3.0545C4.372170000000001,1.7368329999999998,6.02067,1.052,8,1C8,1,8,1,8,1C8,1,8,1,8,1ZM9.047,5.297C9.318,5.297,9.542,5.21633,9.719,5.055C9.896,4.89367,9.9845,4.6775,9.9845,4.406499999999999C9.9845,4.1355,9.896,3.91933,9.719,3.758C9.542,3.59667,9.32067,3.516,9.055,3.516C8.78933,3.516,8.568,3.59667,8.391,3.758C8.214,3.91933,8.125499999999999,4.1355,8.125499999999999,4.406499999999999C8.125499999999999,4.6775,8.214,4.89367,8.391,5.055C8.568,5.21633,8.78683,5.297,9.0475,5.297C9.0475,5.297,9.047,5.297,9.047,5.297C9.047,5.297,9.047,5.297,9.047,5.297ZM9.2345,10.922C9.2345,10.85933,9.23967,10.776,9.25,10.672C9.26033,10.568,9.26033,10.469,9.25,10.375C9.25,10.375,8.422,11.328,8.422,11.328C8.33867,11.4217,8.25267,11.4947,8.164,11.547C8.075330000000001,11.5993,7.99983,11.615,7.9375,11.594C7.84383,11.5523,7.80217,11.4793,7.8125,11.375C7.8125,11.375,9.1875,7.047,9.1875,7.047C9.2395,6.75533,9.19267,6.50533,9.047,6.297C8.90133,6.08867,8.667,5.96367,8.344000000000001,5.922C7.97933,5.93233,7.58083,6.086,7.1485,6.383C6.71617,6.68,6.3385,7.05767,6.0155,7.516C6.0155,7.516,6.0155,7.7505,6.0155,7.7505C6.00517,7.85483,6.00517,7.95383,6.0155,8.0475C6.0155,8.0475,6.8435,7.0945,6.8435,7.0945C6.92683,7.00083,7.01283,6.92783,7.1015,6.8755C7.19017,6.82317,7.2605,6.8075,7.3125,6.8285C7.41683,6.8805,7.45333,6.96383,7.422,7.0785C7.422,7.0785,6.0625,11.391,6.0625,11.391C5.9895,11.6513,6.026,11.8832,6.172,12.0865C6.318,12.2898,6.57317,12.4278,6.9375,12.5005C7.4585,12.4902,7.896,12.3392,8.25,12.0475C8.604,11.7558,8.93217,11.3808,9.2345,10.9225C9.2345,10.9225,9.2345,10.922,9.2345,10.922C9.2345,10.922,9.2345,10.922,9.2345,10.922Z" fill="#FF8C00" fill-opacity="1"/></g></g></svg>

After

Width:  |  Height:  |  Size: 2.3 KiB

1
packages/assets/prompt-icon-3.svg

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="16" height="16" viewBox="0 0 16 16"><defs><clipPath id="master_svg0_242_77707/23_30613"><rect x="0" y="0" width="16" height="16" rx="0"/></clipPath></defs><g clip-path="url(#master_svg0_242_77707/23_30613)"><g><path d="M8,1C9.97933,1.052,11.6278,1.7368329999999998,12.9455,3.0545C14.2632,4.372170000000001,14.948,6.02067,15,8C14.948,9.97933,14.2632,11.6278,12.9455,12.9455C11.6278,14.2632,9.97933,14.948,8,15C6.02067,14.948,4.372170000000001,14.2632,3.0545,12.9455C1.7368329999999998,11.6278,1.052,9.97933,1,8C1.052,6.02067,1.7368329999999998,4.372170000000001,3.0545,3.0545C4.372170000000001,1.7368329999999998,6.02067,1.052,8,1C8,1,8,1,8,1C8,1,8,1,8,1ZM9.047,5.297C9.318,5.297,9.542,5.21633,9.719,5.055C9.896,4.89367,9.9845,4.6775,9.9845,4.406499999999999C9.9845,4.1355,9.896,3.91933,9.719,3.758C9.542,3.59667,9.32067,3.516,9.055,3.516C8.78933,3.516,8.568,3.59667,8.391,3.758C8.214,3.91933,8.125499999999999,4.1355,8.125499999999999,4.406499999999999C8.125499999999999,4.6775,8.214,4.89367,8.391,5.055C8.568,5.21633,8.78683,5.297,9.0475,5.297C9.0475,5.297,9.047,5.297,9.047,5.297C9.047,5.297,9.047,5.297,9.047,5.297ZM9.2345,10.922C9.2345,10.85933,9.23967,10.776,9.25,10.672C9.26033,10.568,9.26033,10.469,9.25,10.375C9.25,10.375,8.422,11.328,8.422,11.328C8.33867,11.4217,8.25267,11.4947,8.164,11.547C8.075330000000001,11.5993,7.99983,11.615,7.9375,11.594C7.84383,11.5523,7.80217,11.4793,7.8125,11.375C7.8125,11.375,9.1875,7.047,9.1875,7.047C9.2395,6.75533,9.19267,6.50533,9.047,6.297C8.90133,6.08867,8.667,5.96367,8.344000000000001,5.922C7.97933,5.93233,7.58083,6.086,7.1485,6.383C6.71617,6.68,6.3385,7.05767,6.0155,7.516C6.0155,7.516,6.0155,7.7505,6.0155,7.7505C6.00517,7.85483,6.00517,7.95383,6.0155,8.0475C6.0155,8.0475,6.8435,7.0945,6.8435,7.0945C6.92683,7.00083,7.01283,6.92783,7.1015,6.8755C7.19017,6.82317,7.2605,6.8075,7.3125,6.8285C7.41683,6.8805,7.45333,6.96383,7.422,7.0785C7.422,7.0785,6.0625,11.391,6.0625,11.391C5.9895,11.6513,6.026,11.8832,6.172,12.0865C6.318,12.2898,6.57317,12.4278,6.9375,12.5005C7.4585,12.4902,7.896,12.3392,8.25,12.0475C8.604,11.7558,8.93217,11.3808,9.2345,10.9225C9.2345,10.9225,9.2345,10.922,9.2345,10.922C9.2345,10.922,9.2345,10.922,9.2345,10.922Z" fill="#FF4D4F" fill-opacity="1"/></g></g></svg>

After

Width:  |  Height:  |  Size: 2.3 KiB

1
packages/assets/radio_checked.svg

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="14" height="14" viewBox="0 0 14 14"><g><g><rect x="0" y="0" width="14" height="14" rx="7" fill="#FFFFFF" fill-opacity="1"/><rect x="0.5" y="0.5" width="13" height="13" rx="6.5" fill-opacity="0" stroke-opacity="1" stroke="#006AFF" fill="none" stroke-width="1"/></g><g><rect x="2.380126953125" y="2.3798828125" width="9.239999771118164" height="9.239999771118164" rx="4.619999885559082" fill="#006AFF" fill-opacity="1"/><rect x="2.710126966238022" y="2.709882825613022" width="8.57999974489212" height="8.57999974489212" rx="4.28999987244606" fill-opacity="0" stroke-opacity="1" stroke="#006AFF" fill="none" stroke-width="0.6600000262260437"/></g></g></svg>

After

Width:  |  Height:  |  Size: 771 B

1
packages/assets/require.svg

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="8" height="8" viewBox="0 0 8 8"><g><g><path d="M4.53619,3.49598C4.93756,3.30242,5.33495,3.10073,5.72813,2.89102C6.10411,2.68903,6.40809,2.53804,6.63208,2.44504C6.85606,2.35305,7.03205,2.30305,7.16805,2.30305C7.39203,2.30305,7.58402,2.37805,7.75201,2.53804C7.912,2.69803,8,2.89102,8,3.126C8,3.26099,7.96,3.40299,7.88001,3.54598C7.80001,3.68897,7.71202,3.78196,7.62402,3.82396C6.80007,4.16794,5.88012,4.41992,4.88817,4.57091C5.07216,4.7389,5.28815,4.97489,5.55214,5.26887C5.81612,5.56285,5.95211,5.71384,5.96811,5.73884C6.06411,5.88183,6.2001,6.05882,6.37609,6.26881C6.55208,6.4788,6.67207,6.63879,6.73607,6.75578C6.80007,6.87377,6.84006,7.01576,6.84006,7.18475C6.84107,7.39587,6.75753,7.5986,6.60808,7.74772C6.45193,7.91074,6.23371,7.99948,6.00811,7.9917C5.76812,7.9917,5.48814,7.78972,5.18416,7.39474C4.88017,7.00776,4.4802,6.29481,4.00022,5.26087C3.51225,6.18481,3.18427,6.80678,3.02428,7.10076C2.85629,7.39474,2.69629,7.62073,2.5443,7.77272C2.40703,7.91778,2.21605,7.99989,2.01633,7.9997C1.79003,8.00605,1.5728,7.91065,1.42436,7.73972C1.28036,7.59025,1.19759,7.39224,1.19238,7.18475C1.19238,6.99976,1.22438,6.86477,1.28837,6.77278C1.88034,5.93283,2.49631,5.19288,3.13627,4.57991C2.65244,4.50186,2.17205,4.40378,1.69635,4.28593C1.23363,4.16226,0.781541,4.00176,0.344425,3.80596C0.264429,3.76496,0.192433,3.67197,0.120437,3.52898C0.0420906,3.41216,0.00031659,3.27466,0.000443602,3.134C-0.00716869,2.91112,0.0835016,2.69615,0.24843,2.54604C0.397403,2.39297,0.602823,2.30798,0.816398,2.31105C0.96839,2.31105,1.16038,2.36105,1.39237,2.45404C1.62435,2.55404,1.91234,2.68903,2.27232,2.88202C2.6323,3.06701,3.03228,3.27699,3.48825,3.50398C3.40825,3.07601,3.33626,2.58804,3.28026,2.04207C3.22427,1.4961,3.20027,1.11813,3.20027,0.916139C3.20027,0.664155,3.27226,0.454168,3.42425,0.277179C3.5641,0.0976285,3.7807,-0.00510704,4.00822,0.000195663C4.24021,0.000195663,4.4322,0.09219,4.58419,0.269179C4.73618,0.454168,4.80818,0.689153,4.80818,0.983135C4.80818,1.06713,4.79218,1.22712,4.77618,1.46311C4.76018,1.70609,4.72018,1.99207,4.68018,2.32805C4.63219,2.67203,4.58419,3.05801,4.53619,3.49598Z" fill="#FF4D4F" fill-opacity="1"/></g></g></svg>

After

Width:  |  Height:  |  Size: 2.2 KiB

40
packages/index.js

@ -0,0 +1,40 @@
import GuipButton from './GuipButton'
import GroupFormBtns from './GroupFormBtns'
import GuipInput from './GuipInput'
import PromptText from './PromptText'
import GuipTextarea from './GuipTextarea'
import DevicePreview from './DevicePreview'
import GuipRadio from './GuipRadio'
import 'element-ui/lib/theme-chalk/index.css' // 如果依赖Element
import './styles/index.css' // 全局引入
import './styles/common.scss' // 全局引入
const components = [
GuipButton,
GroupFormBtns,
GuipInput,
PromptText,
GuipTextarea,
DevicePreview,
GuipRadio
]
const install = function (Vue) {
components.forEach(component => {
if (!component.name) {
throw new Error(`Component name is required: ${component}`)
}
Vue.component(component.name, component)
})
}
export default {
install,
GuipButton,
GroupFormBtns,
GuipInput,
PromptText,
GuipTextarea,
DevicePreview,
GuipRadio
}

1093
packages/styles/common.scss

File diff suppressed because it is too large

BIN
packages/styles/fonts/element-icons.ttf

Binary file not shown.

BIN
packages/styles/fonts/element-icons.woff

Binary file not shown.

26136
packages/styles/index.css

File diff suppressed because it is too large
Loading…
Cancel
Save