添加sql脚本

This commit is contained in:
李郑伟 2025-03-31 10:33:37 +08:00
parent 5333d94f44
commit 64a39866d2

View File

@ -0,0 +1,121 @@
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for work
-- ----------------------------
DROP TABLE IF EXISTS `work`;
CREATE TABLE `work`
(
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`title` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '标题',
`description` longtext CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '描述',
`cover_image_url` longtext CHARACTER SET utf8 COLLATE utf8_general_ci NULL,
`pages` json NULL,
`publish` tinyint(1) NOT NULL DEFAULT 0,
`template` tinyint(1) NOT NULL DEFAULT 0,
`create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '创建时间',
`update_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '更新时间',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB
AUTO_INCREMENT = 14
CHARACTER SET = utf8
COLLATE = utf8_general_ci
ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for work_forms
-- ----------------------------
DROP TABLE IF EXISTS `work_forms`;
CREATE TABLE `work_forms`
(
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`form` longtext CHARACTER SET utf8 COLLATE utf8_general_ci NULL,
`work_id` bigint(20) NOT NULL,
PRIMARY KEY (`id`) USING BTREE,
INDEX `work_id` (`work_id`) USING BTREE,
CONSTRAINT `work_forms_ibfk_1` FOREIGN KEY (`work_id`) REFERENCES `work` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB
AUTO_INCREMENT = 1
CHARACTER SET = utf8
COLLATE = utf8_general_ci
ROW_FORMAT = Dynamic;
SET FOREIGN_KEY_CHECKS = 1;
create table scripts
(
id int auto_increment
primary key,
title varchar(255) not null comment '标题',
content longtext not null comment '内容',
create_time datetime default CURRENT_TIMESTAMP not null,
update_time datetime default CURRENT_TIMESTAMP null on update CURRENT_TIMESTAMP
)
comment '脚本' charset = utf8mb3;
INSERT INTO scripts (id, title, content, create_time, update_time) VALUES (1, '测试脚本1', 'return {
methodsConfig: { //
clickFn: { // methods
label: \'外部跳转1\', //
params: [ //
{
label: \'类型\',
desc: \'query形式参数\',
type: \'object\',
default: \'http://\',
editor: {
type: \'a-select\',
label: \'类型\',
prop: {
options: [
{
"label": "http://",
"value": "http://"
},
{
"label": "https://",
"value": "https://"
},
{
"label": "邮件",
"value": "mailto:"
},
{
"label": "打电话",
"value": "tel:"
},
{
"label": "页码跳转",
"value": "#page"
},
{
"label": "表单提交",
"value": "@submit"
},
{
"label": "分享",
"value": "@share"
}
]
}
}
},
{
label: \'跳转地址\', // 1
desc: \'项目相对地址\', // 1
type: \'string\', // 1string|number|boolean|array|object
default: \'www.baidu.com\', // 1
},
]
}
},
methods:{
clickFn:function(type, url){
console.log(url)
let win = window.open(type+url, \'_blank\')
win.focus()
}
}
}', now(), now());